fix(members): fix error in logs when getting members for public chat

This commit is contained in:
Jonathan Rainville 2022-04-04 12:30:37 -04:00 committed by Iuri Matias
parent 4e8e2e681f
commit 4b78c119c3
1 changed files with 4 additions and 1 deletions

View File

@ -454,7 +454,7 @@ QtObject:
proc makeAdmin*(self: Service, communityID: string, chatID: string, memberId: string) = proc makeAdmin*(self: Service, communityID: string, chatID: string, memberId: string) =
try: try:
let response = status_group_chat.makeAdmin(communityID, chatId, memberId) discard status_group_chat.makeAdmin(communityID, chatId, memberId)
for member in self.chats[chatId].members.mitems: for member in self.chats[chatId].members.mitems:
if (member.id == memberId): if (member.id == memberId):
member.admin = true member.admin = true
@ -492,6 +492,9 @@ QtObject:
try: try:
var realChatId = chatId.replace(communityID, "") var realChatId = chatId.replace(communityID, "")
let response = status_chat.getMembers(communityID, realChatId) let response = status_chat.getMembers(communityID, realChatId)
if response.result.kind == JNull:
# No members. Could be a public chat
return
let myPubkey = singletonInstance.userProfile.getPubKey() let myPubkey = singletonInstance.userProfile.getPubKey()
result = @[] result = @[]
for (id, memberObj) in response.result.pairs: for (id, memberObj) in response.result.pairs: