chore: add some more logs to debug
This commit is contained in:
parent
057b6c2c0f
commit
7b1c7de309
|
@ -46,6 +46,7 @@ proc disconnect*(this: EventEmitter, handlerId: UUID) =
|
||||||
this.events[k].del handlerId
|
this.events[k].del handlerId
|
||||||
|
|
||||||
proc emit*(this:EventEmitter, name:string, args:Args): void =
|
proc emit*(this:EventEmitter, name:string, args:Args): void =
|
||||||
|
echo "Emitting ", name
|
||||||
if this.events.hasKey(name):
|
if this.events.hasKey(name):
|
||||||
# collect the handlers before executing them
|
# collect the handlers before executing them
|
||||||
# because of 'once' proc, we also mutate
|
# because of 'once' proc, we also mutate
|
||||||
|
|
|
@ -56,6 +56,7 @@ QtObject:
|
||||||
self.processSignal(signal)
|
self.processSignal(signal)
|
||||||
|
|
||||||
proc decode(self: SignalsManager, jsonSignal: JsonNode): Signal =
|
proc decode(self: SignalsManager, jsonSignal: JsonNode): Signal =
|
||||||
|
echo jsonSignal
|
||||||
let signalString = jsonSignal{"type"}.getStr
|
let signalString = jsonSignal{"type"}.getStr
|
||||||
var signalType: SignalType
|
var signalType: SignalType
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -179,7 +179,9 @@ proc init*(self: Controller) =
|
||||||
var args = ChatUpdateArgs(e)
|
var args = ChatUpdateArgs(e)
|
||||||
for chat in args.chats:
|
for chat in args.chats:
|
||||||
if self.chatId == chat.id:
|
if self.chatId == chat.id:
|
||||||
|
echo "Chat content"
|
||||||
self.delegate.onChatEdited(chat)
|
self.delegate.onChatEdited(chat)
|
||||||
|
echo "Chat done"
|
||||||
|
|
||||||
proc getMyChatId*(self: Controller): string =
|
proc getMyChatId*(self: Controller): string =
|
||||||
return self.chatId
|
return self.chatId
|
||||||
|
|
|
@ -156,9 +156,11 @@ proc init*(self: Controller) =
|
||||||
var args = ChatUpdateArgs(e)
|
var args = ChatUpdateArgs(e)
|
||||||
for chat in args.chats:
|
for chat in args.chats:
|
||||||
let belongsToCommunity = chat.communityId.len > 0
|
let belongsToCommunity = chat.communityId.len > 0
|
||||||
|
echo "Chat section"
|
||||||
discard self.delegate.addOrUpdateChat(chat, belongsToCommunity, self.events, self.settingsService, self.nodeConfigurationService,
|
discard self.delegate.addOrUpdateChat(chat, belongsToCommunity, self.events, self.settingsService, self.nodeConfigurationService,
|
||||||
self.contactService, self.chatService, self.communityService, self.messageService, self.gifService,
|
self.contactService, self.chatService, self.communityService, self.messageService, self.gifService,
|
||||||
self.mailserversService, setChatAsActive = false)
|
self.mailserversService, setChatAsActive = false)
|
||||||
|
echo "Chat section done"
|
||||||
|
|
||||||
self.events.on(SIGNAL_CHAT_CREATED) do(e: Args):
|
self.events.on(SIGNAL_CHAT_CREATED) do(e: Args):
|
||||||
var args = CreatedChatArgs(e)
|
var args = CreatedChatArgs(e)
|
||||||
|
|
|
@ -80,7 +80,9 @@ proc init*(self: Controller) =
|
||||||
self.events.on(SIGNAL_CHAT_UPDATE) do(e: Args):
|
self.events.on(SIGNAL_CHAT_UPDATE) do(e: Args):
|
||||||
var args = ChatUpdateArgs(e)
|
var args = ChatUpdateArgs(e)
|
||||||
for chat in args.chats:
|
for chat in args.chats:
|
||||||
|
echo "notifications"
|
||||||
self.delegate.addChat(chat)
|
self.delegate.addChat(chat)
|
||||||
|
echo "notifications done"
|
||||||
|
|
||||||
self.events.on(SIGNAL_CHAT_RENAMED) do(e: Args):
|
self.events.on(SIGNAL_CHAT_RENAMED) do(e: Args):
|
||||||
var args = ChatRenameArgs(e)
|
var args = ChatRenameArgs(e)
|
||||||
|
|
|
@ -133,8 +133,11 @@ method addChat*(self: Module, chatDto: ChatDto) =
|
||||||
let ind = self.view.exemptionsModel().findIndexForItemId(chatDto.id)
|
let ind = self.view.exemptionsModel().findIndexForItemId(chatDto.id)
|
||||||
if(ind != -1):
|
if(ind != -1):
|
||||||
return
|
return
|
||||||
|
echo "Create item"
|
||||||
let item = self.createChatItem(chatDto)
|
let item = self.createChatItem(chatDto)
|
||||||
|
echo "created item"
|
||||||
self.view.exemptionsModel().addItem(item)
|
self.view.exemptionsModel().addItem(item)
|
||||||
|
echo "added item"
|
||||||
|
|
||||||
method addChat*(self: Module, itemId: string) =
|
method addChat*(self: Module, itemId: string) =
|
||||||
let ind = self.view.exemptionsModel().findIndexForItemId(itemId)
|
let ind = self.view.exemptionsModel().findIndexForItemId(itemId)
|
||||||
|
|
Loading…
Reference in New Issue