we can receive empty message (for ex for gc_subjects)
This commit is contained in:
		
							parent
							
								
									1092d3d8a7
								
							
						
					
					
						commit
						476cd9a9a0
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		|  | @ -177,8 +177,6 @@ class Connection: | |||
| 	def _messageCB(self, con, msg): | ||||
| 		"""Called when we recieve a message""" | ||||
| 		msgtxt = msg.getBody() | ||||
| 		if not msgtxt: # empty message | ||||
| 			return | ||||
| 		mtype = msg.getType() | ||||
| 		tim = msg.getTimestamp() | ||||
| 		tim = time.strptime(tim, '%Y%m%dT%H:%M:%S') | ||||
|  | @ -207,9 +205,13 @@ class Connection: | |||
| 			if subject: | ||||
| 				self.dispatch('GC_SUBJECT', (str(msg.getFrom()), subject)) | ||||
| 			else: | ||||
| 				if not msgtxt: # empty message | ||||
| 					return | ||||
| 				self.dispatch('GC_MSG', (str(msg.getFrom()), msgtxt, tim)) | ||||
| 				gajim.logger.write('gc', msgtxt, str(msg.getFrom()), tim = tim) | ||||
| 		else: | ||||
| 			if not msgtxt: # empty message | ||||
| 				return | ||||
| 			gajim.logger.write('incoming', msgtxt, str(msg.getFrom()), tim = tim) | ||||
| 			self.dispatch('MSG', (str(msg.getFrom()), msgtxt, tim)) | ||||
| 	# END messageCB | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue