Skip to content

Commit

Permalink
conflict: Remove fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
shuklamaneesh23 committed Jan 13, 2025
1 parent 3fe631a commit d8a7113
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 31 deletions.
4 changes: 0 additions & 4 deletions web/src/buddy_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ export function get_user_circle_class(user_id: number): string {
return "user-circle-active";
case "idle":
return "user-circle-idle";
case "deactivated":
return "user-circle-deactivated";
default:
return "user-circle-offline";
}
Expand All @@ -79,8 +77,6 @@ export function level(user_id: number): number {
return 1;
case "idle":
return 2;
case "deactivated":
return 4;
default:
return 3;
}
Expand Down
5 changes: 5 additions & 0 deletions web/src/pm_list_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type DisplayObject = {
user_circle_class: string | undefined;
is_group: boolean;
is_bot: boolean;
is_deactivated: boolean;
};

export function get_conversations(search_string = ""): DisplayObject[] {
Expand Down Expand Up @@ -83,6 +84,9 @@ export function get_conversations(search_string = ""): DisplayObject[] {
const num_unread = unread.num_unread_for_user_ids_string(user_ids_string);
const is_group = user_ids_string.includes(",");
const is_active = user_ids_string === active_user_ids_string;
const is_deactivated = !people.is_active_user_for_popover(
Number.parseInt(user_ids_string, 10) || 0,
);

let user_circle_class;
let status_emoji_info;
Expand Down Expand Up @@ -112,6 +116,7 @@ export function get_conversations(search_string = ""): DisplayObject[] {
user_circle_class,
is_group,
is_bot,
is_deactivated,
};
display_objects.push(display_object);
}
Expand Down
9 changes: 1 addition & 8 deletions web/src/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type RawPresence = z.infer<typeof presence_schema> & {
};

export type PresenceStatus = {
status: "active" | "idle" | "offline" | "deactivated";
status: "active" | "idle" | "offline";
last_active?: number | undefined;
};

Expand Down Expand Up @@ -60,15 +60,8 @@ export function get_status(user_id: number): PresenceStatus["status"] {
return "offline";
}
if (presence_info.has(user_id)) {
if (presence_info.get(user_id)!.status === undefined) {
return "offline";
}
return presence_info.get(user_id)!.status;
}
if (!people.is_person_active(user_id)) {
return "deactivated";
}

return "offline";
}

Expand Down
1 change: 0 additions & 1 deletion web/styles/input_pill.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
height: var(--length-input-pill-image);
width: var(--length-input-pill-image);
border-radius: 4px 0 0 4px;
display: block;
}

.zulip-icon {
Expand Down
4 changes: 0 additions & 4 deletions web/styles/user_circles.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,3 @@
.user-circle-offline {
color: var(--color-user-circle-offline);
}

.user-circle-deactivated {
color: var(--color-user-circle-deactivated);
}
1 change: 0 additions & 1 deletion web/templates/input_pill.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
{{ display_value }}
</span>
{{~#if should_add_guest_user_indicator}}&nbsp;<i>({{t 'guest'}})</i>{{~/if~}}
{{~#if deactivated}}&nbsp;{{~/if~}}
{{~#if has_status~}}
{{~> status_emoji status_emoji_info~}}
{{~/if~}}
Expand Down
2 changes: 1 addition & 1 deletion web/templates/pm_list_item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{#if is_group}}
<span class="conversation-partners-icon zulip-icon zulip-icon-triple-users"></span>
{{else}}
{{#if (eq user_circle_class "user-circle-deactivated")}}
{{#if is_deactivated}}
<span class="conversation-partners-icon fa fa-ban {{user_circle_class}} user_circle"></span>
{{else}}
<span class="conversation-partners-icon zulip-icon zulip-icon-{{user_circle_class}} {{user_circle_class}} user-circle"></span>
Expand Down
4 changes: 2 additions & 2 deletions web/templates/popovers/user_card/user_card_popover.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div class="popover-menu user-card-popover-actions no-auto-hide-right-sidebar-overlay" id="user_card_popover" data-simplebar data-simplebar-tab-index="-1">
<div class="popover-menu-user-header">
<div class="popover-menu-user-avatar-container {{#if (eq user_circle_class "user-circle-deactivated")}}deactivated{{/if}}">
<div class="popover-menu-user-avatar-container {{#if (not is_active)}}deactivated{{/if}}">
<img class="popover-menu-user-avatar{{#if user_is_guest}} guest-avatar{{/if}}" src="{{user_avatar}}" />
{{#if (and is_active (not is_bot))}}
<div class="popover-menu-user-presence user-circle zulip-icon zulip-icon-{{user_circle_class}} {{user_circle_class}} hidden-for-spectators" data-presence-indicator-user-id="{{user_id}}"></div>
{{/if}}
{{#if (eq user_circle_class "user-circle-deactivated")}}
{{#if (not is_active)}}
<span class="popover-menu-user-presence conversation-partners-icon fa fa-ban fa-lg deactivated-user-icon user_circle"></span>
{{/if}}
</div>
Expand Down
1 change: 0 additions & 1 deletion web/templates/search_user_pill.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<span class="pill-label">
<span class="pill-value">{{ this.full_name }}</span>
{{~#if this.should_add_guest_user_indicator}}&nbsp;<i>({{t 'guest'}})</i>{{~/if~}}
{{~#if deactivated}}&nbsp;{{~/if~}}
{{~#if this.status_emoji_info~}}
{{~> status_emoji this.status_emoji_info~}}
{{~/if~}}
Expand Down
9 changes: 0 additions & 9 deletions web/tests/buddy_data.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,6 @@ test("user_circle, level", ({override}) => {
assert.equal(buddy_data.get_user_circle_class(selma.user_id), "user-circle-idle");
assert.equal(buddy_data.level(selma.user_id), 2);

set_presence(selma.user_id, "deactivated");
assert.equal(buddy_data.get_user_circle_class(selma.user_id), "user-circle-deactivated");
assert.equal(buddy_data.level(selma.user_id), 4);

set_presence(selma.user_id, "offline");
assert.equal(buddy_data.get_user_circle_class(selma.user_id), "user-circle-offline");
assert.equal(buddy_data.level(selma.user_id), 3);
Expand All @@ -176,10 +172,6 @@ test("user_circle, level", ({override}) => {
assert.equal(buddy_data.get_user_circle_class(fred.user_id), "user-circle-idle");
assert.equal(buddy_data.level(fred.user_id), 2);

set_presence(fred.user_id, "deactivated");
assert.equal(buddy_data.get_user_circle_class(fred.user_id), "user-circle-deactivated");
assert.equal(buddy_data.level(fred.user_id), 4);

set_presence(fred.user_id, undefined);
assert.equal(buddy_data.get_user_circle_class(fred.user_id), "user-circle-offline");
assert.equal(buddy_data.level(fred.user_id), 3);
Expand Down Expand Up @@ -569,7 +561,6 @@ test("compare_function", () => {

test("user_last_seen_time_status", ({override}) => {
page_params.presence_history_limit_days_for_web_app = 365;
people.add_active_user(old_user);
set_presence(selma.user_id, "active");
set_presence(me.user_id, "active");

Expand Down
5 changes: 5 additions & 0 deletions web/tests/pm_list_data.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ test("get_conversations", ({override}) => {
{
is_bot: false,
is_active: false,
is_deactivated: false,
is_group: false,
is_zero: false,
recipients: "Me Myself",
Expand All @@ -130,6 +131,7 @@ test("get_conversations", ({override}) => {
unread: 1,
is_zero: false,
is_active: false,
is_deactivated: false,
url: "#narrow/dm/101,102-group",
user_circle_class: undefined,
is_group: true,
Expand Down Expand Up @@ -159,6 +161,7 @@ test("get_conversations", ({override}) => {
unread: 0,
is_zero: true,
is_active: true,
is_deactivated: false,
url: "#narrow/dm/106-Iago",
status_emoji_info: {emoji_code: "20"},
user_circle_class: "user-circle-offline",
Expand Down Expand Up @@ -198,6 +201,7 @@ test("get_conversations bot", ({override}) => {
unread: 1,
is_zero: false,
is_active: false,
is_deactivated: false,
url: "#narrow/dm/314-Outgoing-webhook",
status_emoji_info: undefined,
user_circle_class: "user-circle-offline",
Expand All @@ -210,6 +214,7 @@ test("get_conversations bot", ({override}) => {
unread: 1,
is_zero: false,
is_active: false,
is_deactivated: false,
url: "#narrow/dm/101,102-group",
user_circle_class: undefined,
status_emoji_info: undefined,
Expand Down

0 comments on commit d8a7113

Please sign in to comment.