[FIX] Implement setDescription and setSubject for groups (close #6)

This commit is contained in:
Pedro Lopez
2019-09-08 03:09:07 -04:00
parent cf8c54879e
commit cdfa1760eb
2 changed files with 4 additions and 2 deletions

View File

@@ -86,7 +86,7 @@ class GroupChat extends Chat {
*/
async setSubject(subject) {
let res = await this.client.pupPage.evaluate((chatId, subject) => {
return Store.Chat.get(chatId).setSubject(subject);
return Store.Wap.changeSubject(chatId, subject);
}, this.id._serialized, subject);
if(res.status == 200) {
@@ -100,7 +100,8 @@ class GroupChat extends Chat {
*/
async setDescription(description) {
let res = await this.client.pupPage.evaluate((chatId, description) => {
return Store.Chat.get(chatId).setGroupDesc(description);
let descId = Store.GroupMetadata.get(chatId).descId;
return Store.Wap.setGroupDescription(chatId, description, Store.genId(), descId);
}, this.id._serialized, description);
if (res.status == 200) {

View File

@@ -7,6 +7,7 @@ exports.ExposeStore = (moduleRaidStr) => {
eval("var moduleRaid = " + moduleRaidStr);
window.mR = moduleRaid();
window.Store = window.mR.findModule("Conn")[0].default;
window.Store.genId = window.mR.findModule((module) => module.default && typeof module.default === 'function' && module.default.toString().match(/crypto/))[0].default;
window.Store.SendMessage = window.mR.findModule("sendTextMsgToChat")[0].sendTextMsgToChat;
}