mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-17 00:56:39 +00:00
refactor(chat): rename MESSAGE_FIRST_UNSEEN to FIRST_UNSEEN_MESSAGE_LOADED
- it describes the intention a bit better
This commit is contained in:
parent
9419c9acaf
commit
ac01824ad5
@ -212,11 +212,11 @@ proc init*(self: Controller) =
|
|||||||
if (community.id == self.sectionId):
|
if (community.id == self.sectionId):
|
||||||
self.delegate.updateCommunityDetails(community)
|
self.delegate.updateCommunityDetails(community)
|
||||||
|
|
||||||
self.events.on(SIGNAL_MESSAGE_FIRST_UNSEEN) do(e: Args):
|
self.events.on(SIGNAL_FIRST_UNSEEN_MESSAGE_LOADED) do(e: Args):
|
||||||
let args = MessageFirstUnseen(e)
|
let args = FirstUnseenMessageLoadedArgs(e)
|
||||||
if (args.chatId != self.chatId):
|
if (args.chatId != self.chatId):
|
||||||
return
|
return
|
||||||
self.delegate.onFirstUnseenMessageId(args.messageId)
|
self.delegate.onFirstUnseenMessageLoaded(args.messageId)
|
||||||
|
|
||||||
proc getMySectionId*(self: Controller): string =
|
proc getMySectionId*(self: Controller): string =
|
||||||
return self.sectionId
|
return self.sectionId
|
||||||
|
@ -159,5 +159,5 @@ method markAllMessagesRead*(self: AccessInterface) =
|
|||||||
method updateCommunityDetails*(self: AccessInterface, community: CommunityDto) =
|
method updateCommunityDetails*(self: AccessInterface, community: CommunityDto) =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method onFirstUnseenMessageId*(self: AccessInterface, messageId: string) =
|
method onFirstUnseenMessageLoaded*(self: AccessInterface, messageId: string) =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
@ -716,7 +716,7 @@ proc updateItemsByAlbum(self: Module, items: var seq[Item], message: MessageDto)
|
|||||||
return true
|
return true
|
||||||
return false
|
return false
|
||||||
|
|
||||||
method onFirstUnseenMessageId*(self: Module, messageId: string) =
|
method onFirstUnseenMessageLoaded*(self: Module, messageId: string) =
|
||||||
self.view.model().setFirstUnseenMessageId(messageId)
|
self.view.model().setFirstUnseenMessageId(messageId)
|
||||||
self.view.model().resetNewMessagesMarker()
|
self.view.model().resetNewMessagesMarker()
|
||||||
let index = self.view.model().findIndexForMessageId(messageId)
|
let index = self.view.model().findIndexForMessageId(messageId)
|
||||||
|
@ -40,7 +40,7 @@ const WEEK_AS_MILLISECONDS = initDuration(seconds = 60*60*24*7).inMilliSeconds
|
|||||||
|
|
||||||
# Signals which may be emitted by this service:
|
# Signals which may be emitted by this service:
|
||||||
const SIGNAL_MESSAGES_LOADED* = "messagesLoaded"
|
const SIGNAL_MESSAGES_LOADED* = "messagesLoaded"
|
||||||
const SIGNAL_MESSAGE_FIRST_UNSEEN* = "messageFirstUnseen"
|
const SIGNAL_FIRST_UNSEEN_MESSAGE_LOADED* = "firstUnseenMessageLoaded"
|
||||||
const SIGNAL_NEW_MESSAGE_RECEIVED* = "newMessageReceived"
|
const SIGNAL_NEW_MESSAGE_RECEIVED* = "newMessageReceived"
|
||||||
const SIGNAL_MESSAGE_PINNED* = "messagePinned"
|
const SIGNAL_MESSAGE_PINNED* = "messagePinned"
|
||||||
const SIGNAL_MESSAGE_UNPINNED* = "messageUnpinned"
|
const SIGNAL_MESSAGE_UNPINNED* = "messageUnpinned"
|
||||||
@ -117,7 +117,7 @@ type
|
|||||||
ReloadMessagesArgs* = ref object of Args
|
ReloadMessagesArgs* = ref object of Args
|
||||||
communityId*: string
|
communityId*: string
|
||||||
|
|
||||||
MessageFirstUnseen* = ref object of Args
|
FirstUnseenMessageLoadedArgs* = ref object of Args
|
||||||
chatId*: string
|
chatId*: string
|
||||||
messageId*: string
|
messageId*: string
|
||||||
|
|
||||||
@ -687,8 +687,8 @@ QtObject:
|
|||||||
else:
|
else:
|
||||||
discard responseObj.getProp("messageId", messageId)
|
discard responseObj.getProp("messageId", messageId)
|
||||||
|
|
||||||
self.events.emit(SIGNAL_MESSAGE_FIRST_UNSEEN, MessageFirstUnseen(chatId: chatId, messageId: messageId))
|
self.events.emit(SIGNAL_FIRST_UNSEEN_MESSAGE_LOADED, FirstUnseenMessageLoadedArgs(chatId: chatId, messageId: messageId))
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error "error: ", procName="onGetFirstUnseenMessageIdFor", errName = e.name, errDesription = e.msg
|
error "error: ", procName="onGetFirstUnseenMessageIdFor", errName = e.name, errDesription = e.msg
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user