Skip to content

Commit 3625132

Browse files
committed
model: Extended footer notification outside of streams.
Added check for narrows including PM, Mentions and starred as well apart from only streams. Now footer will display notification if a message is sent outside of any narrow. There are a lot of debugging statements present that will be taken care of in the next commit.
1 parent 55f4097 commit 3625132

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

zulipterminal/model.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -968,17 +968,26 @@ def _handle_message_event(self, event: Event) -> None:
968968
and self.narrow[1][1] == message['subject']))):
969969
msg_log.append(msg_w)
970970

971-
if not append_to_stream:
972-
self.controller.view.set_footer_text(
973-
'Message sent outside of current narrow', 3)
974-
975971
elif (message['type'] == 'private' and len(self.narrow) == 1
976972
and self.narrow[0][0] == "pm_with"):
977973
narrow_recipients = self.recipients
978974
message_recipients = frozenset(
979975
[user['id'] for user in message['display_recipient']])
980976
if narrow_recipients == message_recipients:
981977
msg_log.append(msg_w)
978+
979+
print("message_sender_id =>",message['sender_id'], flush=True)
980+
print("user_id =>",self.user_id, flush=True)
981+
print("message_type =>", message['type'], flush=True)
982+
print("message_subject =>", message['subject'], flush=True)
983+
if (((len(self.narrow) == 1
984+
and self.narrow[0][1] != message['type'])
985+
or (len(self.narrow) == 2
986+
and self.narrow[1][1] != message['subject']))
987+
and message['sender_id'] == self.user_id):
988+
self.controller.view.set_footer_text(
989+
'Message sent outside of current narrow', 3)
990+
982991
self.controller.update_screen()
983992

984993
def _update_topic_index(self, stream_id: int, topic_name: str) -> None:

0 commit comments

Comments
 (0)