Beter handling of status code in MUC. see #3270.
This commit is contained in:
		
							parent
							
								
									97d5ffdb7d
								
							
						
					
					
						commit
						3a1b83228d
					
				
					 2 changed files with 20 additions and 0 deletions
				
			
		| 
						 | 
					@ -1225,6 +1225,9 @@ class Interface:
 | 
				
			||||||
			return
 | 
								return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		changes = []
 | 
							changes = []
 | 
				
			||||||
 | 
							if '100' in statusCode:
 | 
				
			||||||
 | 
								# Can be a presence (see chg_contact_status in groupchat_contol.py)
 | 
				
			||||||
 | 
								changes.append(_('Any occupant is allowed to see your full JID'))
 | 
				
			||||||
		if '102' in statusCode:
 | 
							if '102' in statusCode:
 | 
				
			||||||
			changes.append(_('Room now shows unavailable member'))
 | 
								changes.append(_('Room now shows unavailable member'))
 | 
				
			||||||
		if '103' in statusCode:
 | 
							if '103' in statusCode:
 | 
				
			||||||
| 
						 | 
					@ -1233,6 +1236,7 @@ class Interface:
 | 
				
			||||||
			changes.append(\
 | 
								changes.append(\
 | 
				
			||||||
				_('A non-privacy-related room configuration change has occurred'))
 | 
									_('A non-privacy-related room configuration change has occurred'))
 | 
				
			||||||
		if '170' in statusCode:
 | 
							if '170' in statusCode:
 | 
				
			||||||
 | 
								# Can be a presence (see chg_contact_status in groupchat_contol.py)
 | 
				
			||||||
			changes.append(_('Room logging is now enabled'))
 | 
								changes.append(_('Room logging is now enabled'))
 | 
				
			||||||
		if '171' in statusCode:
 | 
							if '171' in statusCode:
 | 
				
			||||||
			changes.append(_('Room logging is now disabled'))
 | 
								changes.append(_('Room logging is now disabled'))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -890,9 +890,11 @@ class GroupchatControl(ChatControlBase):
 | 
				
			||||||
		# statusCode
 | 
							# statusCode
 | 
				
			||||||
		# http://www.xmpp.org/extensions/xep-0045.html#registrar-statuscodes-init
 | 
							# http://www.xmpp.org/extensions/xep-0045.html#registrar-statuscodes-init
 | 
				
			||||||
		if '100' in statusCode:
 | 
							if '100' in statusCode:
 | 
				
			||||||
 | 
								# Can be a message (see handle_event_gc_config_change in gajim.py)
 | 
				
			||||||
			self.print_conversation(\
 | 
								self.print_conversation(\
 | 
				
			||||||
				_('Any occupant is allowed to see your full JID'))
 | 
									_('Any occupant is allowed to see your full JID'))
 | 
				
			||||||
		if '170' in statusCode:
 | 
							if '170' in statusCode:
 | 
				
			||||||
 | 
								# Can be a message (see handle_event_gc_config_change in gajim.py)
 | 
				
			||||||
			self.print_conversation(_('Room logging is enabled'))
 | 
								self.print_conversation(_('Room logging is enabled'))
 | 
				
			||||||
		if '201' in statusCode:
 | 
							if '201' in statusCode:
 | 
				
			||||||
			self.print_conversation(_('A new room has been created'))
 | 
								self.print_conversation(_('A new room has been created'))
 | 
				
			||||||
| 
						 | 
					@ -959,6 +961,20 @@ class GroupchatControl(ChatControlBase):
 | 
				
			||||||
							os.remove(files[old_file])
 | 
												os.remove(files[old_file])
 | 
				
			||||||
						os.rename(old_file, files[old_file])
 | 
											os.rename(old_file, files[old_file])
 | 
				
			||||||
				self.print_conversation(s, 'info', tim)
 | 
									self.print_conversation(s, 'info', tim)
 | 
				
			||||||
 | 
								elif '321' in statusCode:
 | 
				
			||||||
 | 
									s = _('%(nick)s has been removed from the room (%(reason)s)') % {
 | 
				
			||||||
 | 
										'nick': nick, 'reason': _('affiliation changed') }
 | 
				
			||||||
 | 
									self.print_conversation(s, 'info', tim = tim)
 | 
				
			||||||
 | 
								elif '322' in statusCode:
 | 
				
			||||||
 | 
									s = _('%(nick)s has been removed from the room (%(reason)s)') % {
 | 
				
			||||||
 | 
										'nick': nick,
 | 
				
			||||||
 | 
										'reason': _('room configuration changed to members-only') }
 | 
				
			||||||
 | 
									self.print_conversation(s, 'info', tim = tim)
 | 
				
			||||||
 | 
								elif '332' in statusCode:
 | 
				
			||||||
 | 
									s = _('%(nick)s has been removed from the room (%(reason)s)') % {
 | 
				
			||||||
 | 
										'nick': nick,
 | 
				
			||||||
 | 
										'reason': _('system shutdown') }
 | 
				
			||||||
 | 
									self.print_conversation(s, 'info', tim = tim)
 | 
				
			||||||
			elif 'destroyed' in statusCode: # Room has been destroyed
 | 
								elif 'destroyed' in statusCode: # Room has been destroyed
 | 
				
			||||||
				self.print_conversation(reason, 'info', tim)
 | 
									self.print_conversation(reason, 'info', tim)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue