Skip to content

Commit

Permalink
fix: sogs deleted message now comes with deleted field set to true
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilb committed Aug 8, 2022
1 parent 242d51c commit 3d05d35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export type OpenGroupMessageV4 = {
posted: number;
id: number;
data: string;
deleted: boolean;
};

const pollForEverythingInterval = DURATION.SECONDS * 10;
Expand Down
5 changes: 3 additions & 2 deletions ts/session/apis/open_group_api/sogsv3/sogsApiV3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ const handleSogsV3DeletedMessages = async (
serverUrl: string,
roomId: string
) => {
const deletions = messages.filter(m => m.data === null);
const exceptDeletion = messages.filter(m => m.data !== null);
// FIXME those 2 `m.data === null` test should be removed when we add support for emoji-reacts
const deletions = messages.filter(m => Boolean(m.deleted) || m.data === null);
const exceptDeletion = messages.filter(m => !m.deleted && !m.data === null);
if (!deletions.length) {
return messages;
}
Expand Down

0 comments on commit 3d05d35

Please sign in to comment.