Skip to content

Commit

Permalink
fix(Albums): Fix extra count of messages for image albums
Browse files Browse the repository at this point in the history
Fixes: #9958
  • Loading branch information
borismelnik committed Mar 31, 2023
1 parent 81c3463 commit c051322
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/app/modules/shared_models/message_model.nim
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,15 @@ QtObject:
if messageId.len == 0:
return
for i in 0 ..< self.items.len:
if(self.items[i].id == messageId):
let item = self.items[i]
if(item.id == messageId):
result = i
return
elif item.albumId != "":
for j in 0 ..< item.albumMessageIds.len:
if(item.albumMessageIds[j] == messageId):
result = i
return

proc findIdsOfTheMessagesWhichRespondedToMessageWithId*(self: Model, messageId: string): seq[string] =
for i in 0 ..< self.items.len:
Expand Down

0 comments on commit c051322

Please sign in to comment.