XmppConnection: throw bind failure when server tries to reassign domain
This commit is contained in:
		
							parent
							
								
									82e5a28f49
								
							
						
					
					
						commit
						962add97f9
					
				| @ -1051,7 +1051,12 @@ public class XmppConnection implements Runnable { | |||||||
| 					final Element jid = bind.findChild("jid"); | 					final Element jid = bind.findChild("jid"); | ||||||
| 					if (jid != null && jid.getContent() != null) { | 					if (jid != null && jid.getContent() != null) { | ||||||
| 						try { | 						try { | ||||||
| 							if (account.setJid(Jid.fromString(jid.getContent()))) { | 							Jid assignedJid = Jid.fromString(jid.getContent()); | ||||||
|  | 							if (!account.getJid().getDomainpart().equals(assignedJid.getDomainpart())) { | ||||||
|  | 								Log.d(Config.LOGTAG,account.getJid().toBareJid()+": server tried to re-assign domain to "+assignedJid.getDomainpart()); | ||||||
|  | 								throw new StateChangingError(Account.State.BIND_FAILURE); | ||||||
|  | 							} | ||||||
|  | 							if (account.setJid(assignedJid)) { | ||||||
| 								Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": bare jid changed during bind. updating database"); | 								Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": bare jid changed during bind. updating database"); | ||||||
| 								mXmppConnectionService.databaseBackend.updateAccount(account); | 								mXmppConnectionService.databaseBackend.updateAccount(account); | ||||||
| 							} | 							} | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Daniel Gultsch
						Daniel Gultsch