@@ -227,6 +227,22 @@ function ChatProxy(service, webrtcModule, conn) {
227227 } ;
228228
229229 this . _onIQ = function ( stanza ) {
230+ // var type = stanza.getAttribute('type'),
231+ // typeId = stanza.getAttribute('id').split(':')[1];
232+
233+ // if (typeof self.onListEditListener === 'function' && typeId === 'push') {
234+ // var listName = (stanza.getElementsByTagName('list')[0]).getAttribute('name');
235+
236+ // var iq = $iq({
237+ // from: connection.jid,
238+ // type: 'result',
239+ // id: connection.getUniqueId('push')
240+ // });
241+
242+ // connection.sendIQ(iq);
243+
244+ // Utils.safeCallbackCall(self.onListEditListener(listName));
245+ // }
230246
231247 // we must return true to keep the handler alive
232248 // returning false would remove it after it finishes
@@ -1037,14 +1053,22 @@ PrivacyListProxy.prototype = {
10371053 value : userJid ,
10381054 action : userAction ,
10391055 order : i + 1
1040- } ) . up ( ) ;
1056+ } ) . c ( 'message' , {
1057+ } ) . up ( ) . c ( 'presence-in' , {
1058+ } ) . up ( ) . c ( 'presence-out' , {
1059+ } ) . up ( ) . c ( 'iq' , {
1060+ } ) . up ( ) . up ( ) ;
10411061
10421062 iq . c ( 'item' , {
10431063 type : 'jid' ,
10441064 value : userMuc ,
10451065 action : userAction ,
10461066 order : i + 2
1047- } ) . up ( ) ;
1067+ } ) . c ( 'message' , {
1068+ } ) . up ( ) . c ( 'presence-in' , {
1069+ } ) . up ( ) . c ( 'presence-out' , {
1070+ } ) . up ( ) . c ( 'iq' , {
1071+ } ) . up ( ) . up ( ) ;
10481072 }
10491073
10501074 connection . sendIQ ( iq , function ( stanzaResult ) {
@@ -1061,25 +1085,27 @@ PrivacyListProxy.prototype = {
10611085
10621086 update : function ( list , callback ) {
10631087 var self = this ,
1064- createList ,
10651088 oldArray = [ ] ,
10661089 newArray = [ ] ,
10671090 updatedArray = [ ] ;
10681091
10691092 self . getList ( list . name , function ( error , response ) {
1070- oldArray = response . items ;
1071- newArray = list . items ;
1072- updatedArray = $ . merge ( oldArray , newArray ) ;
1073- list . items = updatedArray ;
1074- createList = list ;
1075-
1076- self . create ( createList , function ( error , response ) {
1077- if ( error ) {
1078- callback ( error , null ) ;
1079- } else {
1080- callback ( null , createList ) ;
1081- }
1082- } ) ;
1093+ if ( error ) {
1094+ callback ( error , null ) ;
1095+ } else {
1096+ oldArray = response . items ;
1097+ newArray = list . items ;
1098+ updatedArray = $ . merge ( oldArray , newArray ) ;
1099+ list . items = updatedArray ;
1100+ createList = list ;
1101+ self . create ( createList , function ( error , response ) {
1102+ if ( error ) {
1103+ callback ( error , null ) ;
1104+ } else {
1105+ callback ( null , createList ) ;
1106+ }
1107+ } ) ;
1108+ }
10831109 } ) ;
10841110 } ,
10851111
0 commit comments