Skip to content

Commit 3af0aac

Browse files
committed
model: Use compare_lowercase() for topics while updating messages.
1 parent 9e87f9e commit 3af0aac

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

zulipterminal/model.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
from zulipterminal.config.keys import keys_for_command
1616
from zulipterminal.helper import (
1717
Message, StreamData, asynch, canonicalize_color, canonicalize_topic,
18-
classify_unread_counts, display_error_if_present, index_messages,
19-
initial_index, notify, set_count,
18+
classify_unread_counts, compare_lowercase, display_error_if_present,
19+
index_messages, initial_index, notify, set_count,
2020
)
2121
from zulipterminal.ui_tools.utils import create_msg_box_list
2222

@@ -911,7 +911,8 @@ def _handle_message_event(self, event: Event) -> None:
911911
if (append_to_stream
912912
and (len(self.narrow) == 1
913913
or (len(self.narrow) == 2
914-
and self.narrow[1][1] == message['subject']))):
914+
and compare_lowercase(self.narrow[1][1],
915+
message['subject'])))):
915916
msg_log.append(msg_w)
916917

917918
elif (message['type'] == 'private' and len(self.narrow) == 1
@@ -1040,7 +1041,8 @@ def _update_rendered_view(self, msg_id: int) -> None:
10401041
# Remove the message if it no longer belongs in the current
10411042
# narrow.
10421043
if (len(self.narrow) == 2
1043-
and msg_box.message['subject'] != self.narrow[1][1]):
1044+
and not compare_lowercase(msg_box.message['subject'],
1045+
self.narrow[1][1])):
10441046
view.message_view.log.remove(msg_w)
10451047
# Change narrow if there are no messages left in the
10461048
# current narrow.

0 commit comments

Comments
 (0)