forked from mukulhase/WebWhatsapp-Wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add function remove participant group
- Loading branch information
1 parent
491cc1a
commit 582f4b1
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
}) | ||
|
||
} |