handle XEP-0200 encrypted messages with extra unencrypted bodies
This commit is contained in:
		
							parent
							
								
									879ceac36c
								
							
						
					
					
						commit
						798c412c85
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
					@ -281,6 +281,11 @@ class EncryptedStanzaSession(StanzaSession):
 | 
				
			||||||
		return self.encrypter.encrypt(padded)
 | 
							return self.encrypter.encrypt(padded)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def decrypt_stanza(self, stanza):
 | 
						def decrypt_stanza(self, stanza):
 | 
				
			||||||
 | 
							# delete the unencrypted explanation body, if it exists
 | 
				
			||||||
 | 
							orig_body = stanza.getTag('body')
 | 
				
			||||||
 | 
							if orig_body:
 | 
				
			||||||
 | 
								stanza.delChild(orig_body)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		c = stanza.getTag(name='c',
 | 
							c = stanza.getTag(name='c',
 | 
				
			||||||
			namespace='http://www.xmpp.org/extensions/xep-0200.html#ns')
 | 
								namespace='http://www.xmpp.org/extensions/xep-0200.html#ns')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue