Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
eef27894
by Daniel Brötzmann at 2019-12-06T21:48:56Z
1 changed file:
Changes:
| ... | ... | @@ -1136,14 +1136,24 @@ class ChatControl(ChatControlBase): |
| 1136 | 1136 |
|
| 1137 | 1137 |
def allow_shutdown(self, method, on_yes, on_no, _on_minimize):
|
| 1138 | 1138 |
time_ = app.last_message_time[self.account][self.get_full_jid()]
|
| 1139 |
+ # 2 seconds
|
|
| 1139 | 1140 |
if time.time() - time_ < 2:
|
| 1140 |
- # 2 seconds
|
|
| 1141 |
+ no_log_for = app.config.get_per(
|
|
| 1142 |
+ 'accounts', self.account, 'no_log_for').split()
|
|
| 1143 |
+ more = ''
|
|
| 1144 |
+ if self.contact.jid in no_log_for:
|
|
| 1145 |
+ more = _('Note: Chat history is disabled for this contact.')
|
|
| 1146 |
+ if self.account in no_log_for:
|
|
| 1147 |
+ more = _('Note: Chat history is disabled for this account.')
|
|
| 1148 |
+ text = _('You just received a new message from %s.\n'
|
|
| 1149 |
+ 'Do you want to close this tab?') % self.contact.get_shown_name()
|
|
| 1150 |
+ if more:
|
|
| 1151 |
+ text += '\n' + more
|
|
| 1152 |
+ |
|
| 1141 | 1153 |
NewConfirmationDialog(
|
| 1142 | 1154 |
_('Close'),
|
| 1143 |
- _('You just received a new message '
|
|
| 1144 |
- 'from %s') % self.contact.jid,
|
|
| 1145 |
- _('If you close this tab while having chat history disabled, '
|
|
| 1146 |
- 'this message will be lost.'),
|
|
| 1155 |
+ _('New Message'),
|
|
| 1156 |
+ text,
|
|
| 1147 | 1157 |
[DialogButton.make('Cancel',
|
| 1148 | 1158 |
callback=lambda: on_no(self)),
|
| 1149 | 1159 |
DialogButton.make('Remove',
|