Page MenuHomePhorge

D15268.1765072974.diff
No OneTemporary

Size
3 KB
Referenced Files
None
Subscribers
None

D15268.1765072974.diff

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
@@ -85,14 +85,27 @@
return;
}
+ const threadHandledByHandlerOnly =
+ threadSpecs[activeThreadInfo.type].protocol()
+ .threadActivityUpdatedByActivityHandlerOnly;
+ const alwaysUpdateActivity =
+ threadSpecs[activeThreadInfo.type].protocol().alwaysUpdateThreadActivity;
+ const activityShouldBeRecorded =
+ threadHandledByHandlerOnly || alwaysUpdateActivity;
+
+ if (!activityShouldBeRecorded) {
+ return;
+ }
+
if (activeThreadInfo.currentUser.unread) {
void updateDMActivity();
return;
}
if (
- activeThreadChanged ||
- activeThreadLatestMessage === prevActiveThreadLatestMessage
+ !alwaysUpdateActivity &&
+ (activeThreadChanged ||
+ activeThreadLatestMessage === prevActiveThreadLatestMessage)
) {
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 @@
threadActivityUpdatedByActivityHandlerOnly: 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,
threadActivityUpdatedByActivityHandlerOnly: 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 @@
threadActivityUpdatedByActivityHandlerOnly: 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
+threadActivityUpdatedByActivityHandlerOnly: 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

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 7, 2:02 AM (3 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5842088
Default Alt Text
D15268.1765072974.diff (3 KB)

Event Timeline