parent
							
								
									1d11e06647
								
							
						
					
					
						commit
						fd6dec1208
					
				
					 3 changed files with 16 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -42,6 +42,15 @@ class Caps:
 | 
			
		|||
        self._create_suitable_client_caps = caps_cache.create_suitable_client_caps
 | 
			
		||||
 | 
			
		||||
    def _presence_received(self, _con, stanza):
 | 
			
		||||
        if stanza.getType() in ('unavailable', 'error'):
 | 
			
		||||
            return
 | 
			
		||||
 | 
			
		||||
        from_ = stanza.getFrom()
 | 
			
		||||
        if from_ is None:
 | 
			
		||||
            # Presence from ourself
 | 
			
		||||
            return
 | 
			
		||||
        full_jid = str(from_)
 | 
			
		||||
 | 
			
		||||
        hash_method = node = caps_hash = None
 | 
			
		||||
 | 
			
		||||
        caps = stanza.getTag('c', namespace=nbxmpp.NS_CAPS)
 | 
			
		||||
| 
						 | 
				
			
			@ -50,8 +59,6 @@ class Caps:
 | 
			
		|||
            node = caps['node']
 | 
			
		||||
            caps_hash = caps['ver']
 | 
			
		||||
 | 
			
		||||
        from_ = stanza.getFrom()
 | 
			
		||||
        full_jid = str(from_)
 | 
			
		||||
        show = parse_show(stanza)
 | 
			
		||||
        type_ = parse_type(stanza)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -74,8 +74,8 @@ class Chatstate:
 | 
			
		|||
            return
 | 
			
		||||
 | 
			
		||||
        full_jid = stanza.getFrom()
 | 
			
		||||
 | 
			
		||||
        if self._con.get_own_jid().bareMatch(full_jid):
 | 
			
		||||
        if full_jid is None or self._con.get_own_jid().bareMatch(full_jid):
 | 
			
		||||
            # Presence from ourself
 | 
			
		||||
            return
 | 
			
		||||
 | 
			
		||||
        contact = app.contacts.get_gc_contact(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -51,12 +51,15 @@ class VCardAvatars:
 | 
			
		|||
            app.config.set_per('accounts', self._account, 'avatar_sha', '')
 | 
			
		||||
 | 
			
		||||
    def _presence_received(self, _con, stanza):
 | 
			
		||||
        update = stanza.getTag('x', namespace=nbxmpp.NS_VCARD_UPDATE)
 | 
			
		||||
        if update is None:
 | 
			
		||||
        if stanza.getType() in ('unavailable', 'error'):
 | 
			
		||||
            return
 | 
			
		||||
 | 
			
		||||
        jid = stanza.getFrom()
 | 
			
		||||
 | 
			
		||||
        update = stanza.getTag('x', namespace=nbxmpp.NS_VCARD_UPDATE)
 | 
			
		||||
        if update is None:
 | 
			
		||||
            return
 | 
			
		||||
 | 
			
		||||
        avatar_sha = update.getTagData('photo')
 | 
			
		||||
        if avatar_sha is None:
 | 
			
		||||
            log.info('%s is not ready to promote an avatar', jid)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue