Show
Ignore:
Timestamp:
08/30/07 22:38:40 (15 months ago)
Author:
roidelapluie
Message:

0.11.2: add now argument to send funtions in zeroconf connection. fixes
#3045

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.11.1/src/common/zeroconf/client_zeroconf.py

    r7501 r8634  
    311311                        self.on_receive = recv_handler 
    312312                 
    313         def send(self, packet, is_message = False): 
    314                 '''Append stanza to the queue of messages to be send.  
     313        def send(self, packet, is_message = False, now = False): 
     314                '''Append stanza to the queue of messages to be send if now is 
     315                False, else send it instantly.  
    315316                If supplied data is unicode string, encode it to utf-8. 
    316317                ''' 
     
    325326                        r = ustr(r).encode('utf-8') 
    326327 
    327                 self.sendqueue.append((r, is_message)) 
     328                if now: 
     329                        self.sendqueue.insert(0, (r, is_message)) 
     330                        self._do_send() 
     331                else: 
     332                        self.sendqueue.append((r, is_message)) 
    328333                self._plug_idle() 
    329334                 
     
    620625                return {} 
    621626 
    622         def send(self, stanza, is_message = False): 
     627        def send(self, stanza, is_message = False, now = False): 
    623628                stanza.setFrom(self.roster.zeroconf.name) 
    624629                to = stanza.getTo()