chore: add some more logs to debug

This commit is contained in:
Jonathan Rainville 2023-08-29 14:22:33 -04:00
parent 057b6c2c0f
commit 7b1c7de309
6 changed files with 11 additions and 0 deletions

View File

@ -46,6 +46,7 @@ proc disconnect*(this: EventEmitter, handlerId: UUID) =
this.events[k].del handlerId
proc emit*(this:EventEmitter, name:string, args:Args): void =
echo "Emitting ", name
if this.events.hasKey(name):
# collect the handlers before executing them
# because of 'once' proc, we also mutate

View File

@ -56,6 +56,7 @@ QtObject:
self.processSignal(signal)
proc decode(self: SignalsManager, jsonSignal: JsonNode): Signal =
echo jsonSignal
let signalString = jsonSignal{"type"}.getStr
var signalType: SignalType
try:

View File

@ -179,7 +179,9 @@ proc init*(self: Controller) =
var args = ChatUpdateArgs(e)
for chat in args.chats:
if self.chatId == chat.id:
echo "Chat content"
self.delegate.onChatEdited(chat)
echo "Chat done"
proc getMyChatId*(self: Controller): string =
return self.chatId

View File

@ -156,9 +156,11 @@ proc init*(self: Controller) =
var args = ChatUpdateArgs(e)
for chat in args.chats:
let belongsToCommunity = chat.communityId.len > 0
echo "Chat section"
discard self.delegate.addOrUpdateChat(chat, belongsToCommunity, self.events, self.settingsService, self.nodeConfigurationService,
self.contactService, self.chatService, self.communityService, self.messageService, self.gifService,
self.mailserversService, setChatAsActive = false)
echo "Chat section done"
self.events.on(SIGNAL_CHAT_CREATED) do(e: Args):
var args = CreatedChatArgs(e)

View File

@ -80,7 +80,9 @@ proc init*(self: Controller) =
self.events.on(SIGNAL_CHAT_UPDATE) do(e: Args):
var args = ChatUpdateArgs(e)
for chat in args.chats:
echo "notifications"
self.delegate.addChat(chat)
echo "notifications done"
self.events.on(SIGNAL_CHAT_RENAMED) do(e: Args):
var args = ChatRenameArgs(e)

View File

@ -133,8 +133,11 @@ method addChat*(self: Module, chatDto: ChatDto) =
let ind = self.view.exemptionsModel().findIndexForItemId(chatDto.id)
if(ind != -1):
return
echo "Create item"
let item = self.createChatItem(chatDto)
echo "created item"
self.view.exemptionsModel().addItem(item)
echo "added item"
method addChat*(self: Module, itemId: string) =
let ind = self.view.exemptionsModel().findIndexForItemId(itemId)