Skip to content

Commit

Permalink
fixed getting community
Browse files Browse the repository at this point in the history
  • Loading branch information
alechkos committed Sep 29, 2023
1 parent 1842db0 commit 4ddd78d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/structures/Community.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const GroupChat = require('./GroupChat');
class Community extends GroupChat {
_patch(data) {
this.groupMetadata = data.groupMetadata;
this.isCommunity = true;

return super._patch(data);
}
Expand Down
8 changes: 4 additions & 4 deletions src/util/Injected.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,11 @@ exports.LoadUtils = () => {
if (chat.groupMetadata) {
const chatWid = window.Store.WidFactory.createWid(chat.id._serialized);
await window.Store.GroupMetadata.update(chatWid);
if (chat.groupMetadata.isParentGroup) {
chat.groupMetadata.defaultSubgroupId = window.Store.CommunityUtils.getDefaultSubgroup(chatWid);
res.isCommunity = true;
}
res.groupMetadata = chat.groupMetadata.serialize();
if (res.groupMetadata.isParentGroup) {
res.groupMetadata.isDefaultSubgroup = res.groupMetadata.defaultSubgroup;
res.groupMetadata.defaultSubgroup = await window.Store.CommunityUtils.getDefaultSubgroup(chatWid);
}
}

res.lastMessage = null;
Expand Down

0 comments on commit 4ddd78d

Please sign in to comment.