mirror of
https://github.com/zulip/zulip.git
synced 2025-11-08 07:52:19 +00:00
recent_topics: Add Private message to recent_topics.
This commit adds private messages to the Recent topics view, to make it an all-encompassing overview of recent activity visible to the user. We add a filter "Include PM" to toggle whether PMs should be shown in recent topics. Fixes #19449.
This commit is contained in:
@@ -29,3 +29,15 @@ export function is_in_focus() {
|
||||
export function get_topic_key(stream_id, topic) {
|
||||
return stream_id + ":" + topic.toLowerCase();
|
||||
}
|
||||
|
||||
export function get_key_from_message(msg) {
|
||||
if (msg.type === "private") {
|
||||
// The to_user_ids field on a private message object is a
|
||||
// string containing the user IDs involved in the message in
|
||||
// sorted order.
|
||||
return msg.to_user_ids;
|
||||
} else if (msg.type === "stream") {
|
||||
return get_topic_key(msg.stream_id, msg.topic);
|
||||
}
|
||||
throw new Error(`Invalid message type ${msg.type}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user