Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
173918c8
by lovetox at 2020-03-20T22:01:53+01:00
2 changed files:
Changes:
| ... | ... | @@ -204,13 +204,14 @@ class Client(ConnectionHandlers): |
| 204 | 204 |
app.nec.push_incoming_event(OurShowEvent(
|
| 205 | 205 |
None, conn=self, show='offline'))
|
| 206 | 206 |
self.process_ssl_errors()
|
| 207 |
- return
|
|
| 208 | 207 |
|
| 209 |
- if domain == StreamError.STREAM:
|
|
| 210 |
- if not self._state.is_disconnecting:
|
|
| 211 |
- self._reconnect = True
|
|
| 208 |
+ elif domain in (StreamError.STREAM, StreamError.BIND):
|
|
| 209 |
+ if error == 'conflict':
|
|
| 210 |
+ # Reset resource
|
|
| 211 |
+ app.config.set_per('accounts', self._account,
|
|
| 212 |
+ 'resource', 'gajim.$rand')
|
|
| 212 | 213 |
|
| 213 |
- if domain == StreamError.SASL:
|
|
| 214 |
+ elif domain == StreamError.SASL:
|
|
| 214 | 215 |
self._reconnect = False
|
| 215 | 216 |
|
| 216 | 217 |
if error in ('not-authorized', 'no-password'):
|
| ... | ... | @@ -897,37 +897,6 @@ class Interface: |
| 897 | 897 |
input_str=obj.alt_name,
|
| 898 | 898 |
transient_for=self.roster.window).show()
|
| 899 | 899 |
|
| 900 |
- def handle_event_resource_conflict(self, obj):
|
|
| 901 |
- # ('RESOURCE_CONFLICT', account, ())
|
|
| 902 |
- # First we go offline, but we don't overwrite status message
|
|
| 903 |
- account = obj.conn.name
|
|
| 904 |
- conn = obj.conn
|
|
| 905 |
- self.roster.send_status(account, 'offline', conn.status_message)
|
|
| 906 |
- |
|
| 907 |
- def _set_resource(new_resource):
|
|
| 908 |
- app.config.set_per('accounts', account, 'resource', new_resource)
|
|
| 909 |
- self.roster.send_status(account, conn.status, conn.status_message)
|
|
| 910 |
- |
|
| 911 |
- proposed_resource = conn.server_resource
|
|
| 912 |
- if proposed_resource.startswith('gajim.'):
|
|
| 913 |
- # Dont notify the user about resource change if he didn't set
|
|
| 914 |
- # a custom resource
|
|
| 915 |
- _set_resource('gajim.$rand')
|
|
| 916 |
- return
|
|
| 917 |
- |
|
| 918 |
- proposed_resource += app.config.get('gc_proposed_nick_char')
|
|
| 919 |
- |
|
| 920 |
- InputDialog(
|
|
| 921 |
- _('Resource Conflict'),
|
|
| 922 |
- _('Resource Conflict'),
|
|
| 923 |
- _('You are already connected to this account with the same '
|
|
| 924 |
- 'resource. Please enter a different one.'),
|
|
| 925 |
- [DialogButton.make('Cancel'),
|
|
| 926 |
- DialogButton.make('Accept',
|
|
| 927 |
- text=_('_Connect'),
|
|
| 928 |
- callback=_set_resource)],
|
|
| 929 |
- input_str=proposed_resource).show()
|
|
| 930 |
- |
|
| 931 | 900 |
def handle_event_jingleft_cancel(self, obj):
|
| 932 | 901 |
ft = self.instances['file_transfers']
|
| 933 | 902 |
file_props = None
|
| ... | ... | @@ -1081,7 +1050,6 @@ class Interface: |
| 1081 | 1050 |
'roster-item-exchange-received': \
|
| 1082 | 1051 |
[self.handle_event_roster_item_exchange],
|
| 1083 | 1052 |
'signed-in': [self.handle_event_signed_in],
|
| 1084 |
- 'stream-conflict-received': [self.handle_event_resource_conflict],
|
|
| 1085 | 1053 |
'subscribe-presence-received': [
|
| 1086 | 1054 |
self.handle_event_subscribe_presence],
|
| 1087 | 1055 |
'subscribed-presence-received': [
|