fix: leave chat groups

This commit is contained in:
Richard Ramos 2021-04-05 09:31:59 -04:00 committed by Iuri Matias
parent 6417628531
commit 52b18c0c82
1 changed files with 5 additions and 1 deletions

View File

@ -201,7 +201,11 @@ proc addMailserverTopic*(self: MailserverModel, topic: MailserverTopic) =
discard status_mailservers.addMailserverTopic(topic)
proc deleteMailserverTopic*(self: MailserverModel, chatId: string) =
var topic:MailserverTopic = self.getMailserverTopicsByChatId(chatId)[0]
var topics = self.getMailserverTopicsByChatId(chatId)
if topics.len == 0:
return
var topic:MailserverTopic = topics[0]
if(topic.chatIds.len > 1):
discard status_mailservers.addMailserverTopic(topic)
else: