fixup for pep omemo notification dedup
This commit is contained in:
		
							parent
							
								
									9a796df2a3
								
							
						
					
					
						commit
						782b8fb744
					
				| 
						 | 
					@ -391,11 +391,13 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
 | 
				
			||||||
	public void registerDevices(final Jid jid, @NonNull final Set<Integer> deviceIds) {
 | 
						public void registerDevices(final Jid jid, @NonNull final Set<Integer> deviceIds) {
 | 
				
			||||||
		final int hash = deviceIds.hashCode();
 | 
							final int hash = deviceIds.hashCode();
 | 
				
			||||||
		final boolean me = jid.toBareJid().equals(account.getJid().toBareJid());
 | 
							final boolean me = jid.toBareJid().equals(account.getJid().toBareJid());
 | 
				
			||||||
		if (me && hash == this.lastDeviceListNotificationHash) {
 | 
							if (me) {
 | 
				
			||||||
			Log.d(Config.LOGTAG,account.getJid().toBareJid()+": ignoring duplicate own device id list");
 | 
								if (hash == this.lastDeviceListNotificationHash) {
 | 
				
			||||||
 | 
									Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": ignoring duplicate own device id list");
 | 
				
			||||||
				return;
 | 
									return;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			this.lastDeviceListNotificationHash = hash;
 | 
								this.lastDeviceListNotificationHash = hash;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		boolean needsPublishing = me && !deviceIds.contains(getOwnDeviceId());
 | 
							boolean needsPublishing = me && !deviceIds.contains(getOwnDeviceId());
 | 
				
			||||||
		if (me) {
 | 
							if (me) {
 | 
				
			||||||
			deviceIds.remove(getOwnDeviceId());
 | 
								deviceIds.remove(getOwnDeviceId());
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1250,7 +1250,7 @@ public class XmppConnectionService extends Service {
 | 
				
			||||||
					if (!message.needsUploading()) {
 | 
										if (!message.needsUploading()) {
 | 
				
			||||||
						String pgpBody = message.getEncryptedBody();
 | 
											String pgpBody = message.getEncryptedBody();
 | 
				
			||||||
						String decryptedBody = message.getBody();
 | 
											String decryptedBody = message.getBody();
 | 
				
			||||||
						message.setBody(pgpBody);
 | 
											message.setBody(pgpBody); //TODO might throw NPE
 | 
				
			||||||
						message.setEncryption(Message.ENCRYPTION_PGP);
 | 
											message.setEncryption(Message.ENCRYPTION_PGP);
 | 
				
			||||||
						if (message.edited()) {
 | 
											if (message.edited()) {
 | 
				
			||||||
							message.setBody(decryptedBody);
 | 
												message.setBody(decryptedBody);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue