|
24 | 24 | ) |
25 | 25 | from zulipterminal.helper import ( |
26 | 26 | Message, format_string, match_emoji, match_group, match_stream, |
27 | | - match_topics, match_user, |
| 27 | + match_topics, match_user, unauthorised_warning, |
28 | 28 | ) |
29 | 29 | from zulipterminal.ui_tools.buttons import EditModeButton |
30 | 30 | from zulipterminal.ui_tools.tables import render_table |
@@ -440,6 +440,8 @@ def keypress(self, size: urwid_Size, key: str) -> Optional[str]: |
440 | 440 | ) |
441 | 441 | self.view.set_footer_text(invalid_stream_error, 3) |
442 | 442 | return key |
| 443 | + elif unauthorised_warning(self.model, stream_name): |
| 444 | + return key |
443 | 445 | user_ids = self.model.get_other_subscribers_in_stream( |
444 | 446 | stream_name=stream_name) |
445 | 447 | self.recipient_user_ids = user_ids |
@@ -1166,11 +1168,13 @@ def keypress(self, size: urwid_Size, key: str) -> Optional[str]: |
1166 | 1168 | recipient_user_ids=self.recipient_ids, |
1167 | 1169 | ) |
1168 | 1170 | elif self.message['type'] == 'stream': |
1169 | | - self.model.controller.view.write_box.stream_box_view( |
1170 | | - caption=self.message['display_recipient'], |
1171 | | - title=self.message['subject'], |
1172 | | - stream_id=self.stream_id, |
1173 | | - ) |
| 1171 | + if not unauthorised_warning(self.model, |
| 1172 | + self.message.get('stream_id')): |
| 1173 | + self.model.controller.view.write_box.stream_box_view( |
| 1174 | + caption=self.message['display_recipient'], |
| 1175 | + title=self.message['subject'], |
| 1176 | + stream_id=self.stream_id, |
| 1177 | + ) |
1174 | 1178 | elif is_command_key('STREAM_MESSAGE', key): |
1175 | 1179 | if self.message['type'] == 'private': |
1176 | 1180 | self.model.controller.view.write_box.private_box_view( |
|
0 commit comments