@@ -1057,6 +1057,7 @@ PrivacyListProxy.prototype = {
1057
1057
var iq , self = this ,
1058
1058
userId , userJid ,
1059
1059
userAction , userMuc ,
1060
+ mutualBlock ,
1060
1061
listObj = { } ,
1061
1062
listKeys = [ ] ;
1062
1063
@@ -1071,7 +1072,10 @@ PrivacyListProxy.prototype = {
1071
1072
} ) ;
1072
1073
1073
1074
$ ( list . items ) . each ( function ( e , i ) {
1074
- listObj [ i . user_id ] = i . action ;
1075
+ listObj [ i . user_id ] = {
1076
+ action : i . action ,
1077
+ mutualBlock : i . mutualBlock === true ? true : false
1078
+ } ;
1075
1079
} ) ;
1076
1080
1077
1081
listKeys = Object . keys ( listObj ) ;
@@ -1081,28 +1085,45 @@ PrivacyListProxy.prototype = {
1081
1085
userAction = listObj [ userId ] ;
1082
1086
userJid = self . helpers . jidOrUserId ( parseInt ( userId , 10 ) ) ;
1083
1087
userMuc = self . helpers . getUserNickWithMucDomain ( userId ) ;
1084
-
1085
- iq . c ( 'item' , {
1086
- type : 'jid' ,
1087
- value : userJid ,
1088
- action : userAction ,
1089
- order : i + 1
1090
- } ) . c ( 'message' , {
1091
- } ) . up ( ) . c ( 'presence-in' , {
1092
- } ) . up ( ) . c ( 'presence-out' , {
1093
- } ) . up ( ) . c ( 'iq' , {
1094
- } ) . up ( ) . up ( ) ;
1095
-
1096
- iq . c ( 'item' , {
1097
- type : 'jid' ,
1098
- value : userMuc ,
1099
- action : userAction ,
1100
- order : i + 2
1101
- } ) . c ( 'message' , {
1102
- } ) . up ( ) . c ( 'presence-in' , {
1103
- } ) . up ( ) . c ( 'presence-out' , {
1104
- } ) . up ( ) . c ( 'iq' , {
1105
- } ) . up ( ) . up ( ) ;
1088
+ mutualBlock = listObj [ userId ] . mutualBlock ;
1089
+
1090
+ if ( ! mutualBlock && userAction !== 'deny' ) {
1091
+ iq . c ( 'item' , {
1092
+ type : 'jid' ,
1093
+ value : userJid ,
1094
+ action : userAction ,
1095
+ order : i + 1
1096
+ } ) . c ( 'message' , {
1097
+ } ) . up ( ) . c ( 'presence-in' , {
1098
+ } ) . up ( ) . c ( 'presence-out' , {
1099
+ } ) . up ( ) . c ( 'iq' , {
1100
+ } ) . up ( ) . up ( ) ;
1101
+
1102
+ iq . c ( 'item' , {
1103
+ type : 'jid' ,
1104
+ value : userMuc ,
1105
+ action : userAction ,
1106
+ order : i + 2
1107
+ } ) . c ( 'message' , {
1108
+ } ) . up ( ) . c ( 'presence-in' , {
1109
+ } ) . up ( ) . c ( 'presence-out' , {
1110
+ } ) . up ( ) . c ( 'iq' , {
1111
+ } ) . up ( ) . up ( ) ;
1112
+ } else {
1113
+ iq . c ( 'item' , {
1114
+ type : 'jid' ,
1115
+ value : userJid ,
1116
+ action : userAction ,
1117
+ order : i + 1
1118
+ } ) . up ( ) ;
1119
+
1120
+ iq . c ( 'item' , {
1121
+ type : 'jid' ,
1122
+ value : userMuc ,
1123
+ action : userAction ,
1124
+ order : i + 2
1125
+ } ) . up ( ) ;
1126
+ }
1106
1127
}
1107
1128
1108
1129
connection . sendIQ ( iq , function ( stanzaResult ) {
0 commit comments