Skip to content

Commit

Permalink
add function remove participant group
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloruan0710 committed Sep 13, 2018
1 parent 491cc1a commit 582f4b1
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions webwhatsapi/js/wapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -1268,4 +1268,29 @@ window.WAPI.contactUnblock = function(id, done){
}
done(false);
return false;
}

/**
*
* @param {*} idGroup '[email protected]'
* @param {*} idParticipant '[email protected]'
* @param {*} done - function - Callback function to be called when a new message arrives.
*/
window.WAPI.removeParticipantGroup = function(idGroup, idParticipant, done){
const metaDataGroup = window.Store.GroupMetadata.get(idGroup);
if (metaDataGroup === undefined){
done(false); return false;
}

const participant = metaDataGroup.participants.get(idParticipant);
if (participant === undefined){
done(false); return false;
}

metaDataGroup.participants.removeParticipants([participant], function(){
const check = metaDataGroup.participants.get(idParticipant);
if (check === undefined){ done(true); return true; }
done(false); return false;
})

}

0 comments on commit 582f4b1

Please sign in to comment.