mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 00:18:12 +00:00
recent_view_ui: Make tooltip data compatible with buddy_data.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
df657e7208
commit
4f297bee32
@@ -232,16 +232,15 @@ export function info_for(user_id: number): BuddyUserInfo {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function get_title_data(
|
export type TitleData = {
|
||||||
user_ids_string: string,
|
|
||||||
is_group: boolean,
|
|
||||||
): {
|
|
||||||
first_line: string;
|
first_line: string;
|
||||||
second_line: string | undefined;
|
second_line: string | undefined;
|
||||||
third_line: string;
|
third_line: string;
|
||||||
show_you?: boolean;
|
show_you?: boolean;
|
||||||
is_deactivated?: boolean;
|
is_deactivated?: boolean;
|
||||||
} {
|
};
|
||||||
|
|
||||||
|
export function get_title_data(user_ids_string: string, is_group: boolean): TitleData {
|
||||||
if (is_group) {
|
if (is_group) {
|
||||||
// For groups, just return a string with recipient names.
|
// For groups, just return a string with recipient names.
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -496,11 +496,7 @@ function message_to_conversation_unread_count(msg: Message): number {
|
|||||||
return unread.num_unread_for_topic(msg.stream_id, msg.topic);
|
return unread.num_unread_for_topic(msg.stream_id, msg.topic);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function get_pm_tooltip_data(user_ids_string: string): {
|
export function get_pm_tooltip_data(user_ids_string: string): buddy_data.TitleData {
|
||||||
first_line: string;
|
|
||||||
second_line: string;
|
|
||||||
third_line?: string;
|
|
||||||
} {
|
|
||||||
const user_id = Number.parseInt(user_ids_string, 10);
|
const user_id = Number.parseInt(user_ids_string, 10);
|
||||||
const person = people.get_by_user_id(user_id);
|
const person = people.get_by_user_id(user_id);
|
||||||
|
|
||||||
@@ -516,6 +512,7 @@ export function get_pm_tooltip_data(user_ids_string: string): {
|
|||||||
return {
|
return {
|
||||||
first_line: person.full_name,
|
first_line: person.full_name,
|
||||||
second_line: bot_owner_name,
|
second_line: bot_owner_name,
|
||||||
|
third_line: "",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user