File tree Expand file tree Collapse file tree 3 files changed +39
-6
lines changed Expand file tree Collapse file tree 3 files changed +39
-6
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ var sampleConfig = {
1313 mainColor : "#ff6d6d" ,
1414 saveDb : false ,
1515 enableShadow : true ,
16- enableTip : true
16+ enableTip : true ,
17+ isAntiRecallSelfMsg : false
1718} ;
1819
1920var nowConfig = { } ;
@@ -335,8 +336,9 @@ function onBrowserWindowCreated(window) {
335336 null &&
336337 item . elements [ 0 ] . grayTipElement
337338 . revokeElement != null &&
338- ! item . elements [ 0 ] . grayTipElement
339- . revokeElement . isSelfOperate
339+ ( nowConfig . isAntiRecallSelfMsg ||
340+ ! item . elements [ 0 ] . grayTipElement
341+ . revokeElement . isSelfOperate )
340342 ) {
341343 needUpdateIdx . push ( idx ) ;
342344 }
@@ -478,8 +480,9 @@ function onBrowserWindowCreated(window) {
478480 null &&
479481 msgList . elements [ 0 ] . grayTipElement
480482 . revokeElement != null &&
481- ! msgList . elements [ 0 ] . grayTipElement
482- . revokeElement . isSelfOperate
483+ ( nowConfig . isAntiRecallSelfMsg ||
484+ ! msgList . elements [ 0 ] . grayTipElement
485+ . revokeElement . isSelfOperate )
483486 ) {
484487 window . webContents . send (
485488 "LiteLoader.anti_recall.mainWindow.recallTip" ,
Original file line number Diff line number Diff line change 44 "name" : " 防撤回" ,
55 "slug" : " anti_recall" ,
66 "description" : " 防止QQNT撤回消息" ,
7- "version" : " 0.2.13 " ,
7+ "version" : " 0.2.14 " ,
88 "thumbnail" : " ./icon.png" ,
99 "author" : {
1010 "name" : " XiaoHe321" ,
Original file line number Diff line number Diff line change @@ -28,6 +28,18 @@ export async function onConfigView(view) {
2828 </div>
2929 </div>
3030
31+ <hr class="horizontal-dividing-line" />
32+ <div class="vertical-list-item">
33+ <div style="width:90%;" >
34+ <h2>是否反撤回自己的消息</h2>
35+ <span class="secondary-text">如果开启,则自己发送的消息也会被反撤回。开启后,从下一条消息开始起生效。</span>
36+ </div>
37+ <div id="switchAntiRecallSelf" class="q-switch">
38+ <span class="q-switch__handle"></span>
39+ </div>
40+ </div>
41+
42+
3143 </div>
3244
3345 </div>
@@ -325,6 +337,24 @@ export async function onConfigView(view) {
325337 await window . anti_recall . saveConfig ( nowConfig ) ;
326338 } ) ;
327339
340+ //反撤回自己消息开关
341+ var q_switch_antiself = node2 . querySelector ( "#switchAntiRecallSelf" ) ;
342+
343+ if ( nowConfig . isAntiRecallSelfMsg == true ) {
344+ q_switch_antiself . classList . toggle ( "is-active" ) ;
345+ }
346+
347+ q_switch_antiself . addEventListener ( "click" , async ( ) => {
348+ if ( q_switch_antiself . classList . contains ( "is-active" ) ) {
349+ nowConfig . isAntiRecallSelfMsg = false ;
350+ } else {
351+ nowConfig . isAntiRecallSelfMsg = true ;
352+ }
353+ q_switch_antiself . classList . toggle ( "is-active" ) ;
354+ await window . anti_recall . saveConfig ( nowConfig ) ;
355+ } ) ;
356+
357+
328358 //阴影开关
329359 var q_switch_shadow = node2 . querySelector ( "#switchShadow" ) ;
330360
You can’t perform that action at this time.
0 commit comments