send offline status to gc before we disconnect
This commit is contained in:
		
							parent
							
								
									d58f380842
								
							
						
					
					
						commit
						cec9b1e861
					
				
					 2 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
					@ -2215,7 +2215,9 @@ class Connection:
 | 
				
			||||||
		p = common.xmpp.Presence(to = '%s/%s' % (jid, nick), typ = ptype,
 | 
							p = common.xmpp.Presence(to = '%s/%s' % (jid, nick), typ = ptype,
 | 
				
			||||||
			show = show, status = status)
 | 
								show = show, status = status)
 | 
				
			||||||
		p = self.add_sha(p)
 | 
							p = self.add_sha(p)
 | 
				
			||||||
		self.to_be_sent.append(p)
 | 
							# send instantly so when we go offline, status is sent to gc before we
 | 
				
			||||||
 | 
							# disconnect from jabber server
 | 
				
			||||||
 | 
							self.connection.send(p)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def gc_set_role(self, room_jid, nick, role, reason = ''):
 | 
						def gc_set_role(self, room_jid, nick, role, reason = ''):
 | 
				
			||||||
		'''role is for all the life of the room so it's based on nick'''
 | 
							'''role is for all the life of the room so it's based on nick'''
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1491,12 +1491,12 @@ _('If "%s" accepts this request you will know his or her status.') %jid)
 | 
				
			||||||
														passphrase)
 | 
																			passphrase)
 | 
				
			||||||
					gajim.connections[account].gpg_passphrase(passphrase)
 | 
										gajim.connections[account].gpg_passphrase(passphrase)
 | 
				
			||||||
					
 | 
										
 | 
				
			||||||
		gajim.connections[account].change_status(status, txt, sync, auto)
 | 
					 | 
				
			||||||
		for room_jid in gajim.interface.instances[account]['gc']:
 | 
							for room_jid in gajim.interface.instances[account]['gc']:
 | 
				
			||||||
			if room_jid != 'tabbed':
 | 
								if room_jid != 'tabbed':
 | 
				
			||||||
				nick = gajim.interface.instances[account]['gc'][room_jid].nicks[room_jid]
 | 
									nick = gajim.interface.instances[account]['gc'][room_jid].nicks[room_jid]
 | 
				
			||||||
				gajim.connections[account].send_gc_status(nick, room_jid, status, 
 | 
									gajim.connections[account].send_gc_status(nick, room_jid, status, 
 | 
				
			||||||
					txt)
 | 
										txt)
 | 
				
			||||||
 | 
							gajim.connections[account].change_status(status, txt, sync, auto)
 | 
				
			||||||
		if status == 'online' and gajim.interface.sleeper.getState() != \
 | 
							if status == 'online' and gajim.interface.sleeper.getState() != \
 | 
				
			||||||
			common.sleepy.STATE_UNKNOWN:
 | 
								common.sleepy.STATE_UNKNOWN:
 | 
				
			||||||
			gajim.sleeper_state[account] = 'online'
 | 
								gajim.sleeper_state[account] = 'online'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue