diff --git a/lib/handlers/non-keyserver-activity-handler.js b/lib/handlers/non-keyserver-activity-handler.js --- a/lib/handlers/non-keyserver-activity-handler.js +++ b/lib/handlers/non-keyserver-activity-handler.js @@ -78,14 +78,24 @@ !viewerID || !activeThread || !activeThreadInfo || - !threadSpecs[activeThreadInfo.type].protocol() - .threadActivityUpdatedActivityHandlerOnly || threadIsPending(activeThread) ) { return; } - if (activeThreadInfo.currentUser.unread) { + const threadHandledByHandlerOnly = + threadSpecs[activeThreadInfo.type].protocol() + .threadActivityUpdatedActivityHandlerOnly; + const alwaysUpdateActivity = + threadSpecs[activeThreadInfo.type].protocol().alwaysUpdateThreadActivity; + const activityShouldBeRecorded = + threadHandledByHandlerOnly || alwaysUpdateActivity; + + if (!activityShouldBeRecorded) { + return; + } + + if (activeThreadInfo.currentUser.unread || alwaysUpdateActivity) { void updateDMActivity(); return; } diff --git a/lib/shared/threads/protocols/dm-thread-protocol.js b/lib/shared/threads/protocols/dm-thread-protocol.js --- a/lib/shared/threads/protocols/dm-thread-protocol.js +++ b/lib/shared/threads/protocols/dm-thread-protocol.js @@ -919,6 +919,8 @@ threadActivityUpdatedActivityHandlerOnly: true, + alwaysUpdateThreadActivity: false, + membershipMessageNotifAction: messageNotifyTypes.SET_UNREAD, shouldConvertIDs: false, diff --git a/lib/shared/threads/protocols/farcaster-thread-protocol.js b/lib/shared/threads/protocols/farcaster-thread-protocol.js --- a/lib/shared/threads/protocols/farcaster-thread-protocol.js +++ b/lib/shared/threads/protocols/farcaster-thread-protocol.js @@ -395,6 +395,7 @@ messagesStoredOnServer: false, arePendingThreadsDescendantsOfGenesis: false, threadActivityUpdatedActivityHandlerOnly: false, + alwaysUpdateThreadActivity: true, membershipMessageNotifAction: messageNotifyTypes.NONE, shouldConvertIDs: false, dataIsBackedUp: true, diff --git a/lib/shared/threads/protocols/keyserver-thread-protocol.js b/lib/shared/threads/protocols/keyserver-thread-protocol.js --- a/lib/shared/threads/protocols/keyserver-thread-protocol.js +++ b/lib/shared/threads/protocols/keyserver-thread-protocol.js @@ -675,6 +675,8 @@ threadActivityUpdatedActivityHandlerOnly: false, + alwaysUpdateThreadActivity: false, + membershipMessageNotifAction: messageNotifyTypes.NONE, shouldConvertIDs: true, diff --git a/lib/shared/threads/thread-spec.js b/lib/shared/threads/thread-spec.js --- a/lib/shared/threads/thread-spec.js +++ b/lib/shared/threads/thread-spec.js @@ -429,6 +429,10 @@ // This flag is temporary. It should be deleted as a part of // https://linear.app/comm/issue/ENG-10729/consider-merging-activity-handlers +threadActivityUpdatedActivityHandlerOnly: boolean, + // This property makes sure that activity is sent always, regardless of + // the previous state. Example: information that the thread is read is + // sent on each open, not only if it was unread previously. + +alwaysUpdateThreadActivity: boolean, +membershipMessageNotifAction: MessageNotifyType, +shouldConvertIDs: boolean, // This flag specifies that all data created or updated should be included