Exemplo n.º 1
0
 def subscribeApprove(self, approve, to):
     if approve:
         self.send_presence(pto=to, ptype='subscribed')
         #If there was no subscription from us, we send it
         #and add to our contact list
         if not self.client_roster[to]['to']:
             self.send_presence(pto=to, ptype='subscribe')
             signals.getSignals().rosterChanged.emit([str(to)])
     else:
         self.send_presence(pto=to, ptype='unsubscribed')
Exemplo n.º 2
0
 def subscribeApprove(self, approve, to):
     if approve:
         self.send_presence(pto=to, ptype='subscribed')
         #If there was no subscription from us, we send it
         #and add to our contact list
         if not self.client_roster[to]['to']:
             self.send_presence(pto=to, ptype='subscribe')
             signals.getSignals().rosterChanged.emit([str(to)])
     else:
         self.send_presence(pto=to, ptype='unsubscribed')
Exemplo n.º 3
0
 def onOffline(self, presence):
     if 'conference' in str(presence['from']):
         return
     else:
         signals.getSignals().contact_offline.emit(presence)
Exemplo n.º 4
0
 def onDisconnect(self, event):
     self.connected = False
     signals.getSignals().disconnected.emit()
Exemplo n.º 5
0
 def onAuthFailed(self, event):
     signals.getSignals().auth_failed.emit()
Exemplo n.º 6
0
 def onMessage(self, message):
     if str(message['from']).split('/')[0] not in self.client_roster:
         return
     signals.getSignals().message_received.emit(message)
Exemplo n.º 7
0
 def onStart(self, event):
     self.send_presence()
     self.get_roster()
     signals.getSignals().session_start.emit(self.client_roster)
Exemplo n.º 8
0
 def onUnSubscribed(self, presence):
     signals.getSignals().unsubs_in.emit(str(presence['from']))
Exemplo n.º 9
0
 def subscribe_to_contact(self, to):
     self.send_presence(pto=to, ptype='subscribe')
     signals.getSignals().rosterChanged.emit([to])
Exemplo n.º 10
0
 def onDisconnect(self, event):
     self.connected = False
     signals.getSignals().disconnected.emit()
Exemplo n.º 11
0
 def onOffline(self, presence):
     if 'conference' in str(presence['from']):
         return
     else:
         signals.getSignals().contact_offline.emit(presence)
Exemplo n.º 12
0
 def onAuthFailed(self, event):
     signals.getSignals().auth_failed.emit()
Exemplo n.º 13
0
 def onMessage(self, message):
     if str(message['from']).split('/')[0] not in self.client_roster:
         return
     signals.getSignals().message_received.emit(message)
Exemplo n.º 14
0
 def onStart(self, event):
     self.send_presence()
     self.get_roster()
     signals.getSignals().session_start.emit(self.client_roster)
Exemplo n.º 15
0
 def onUnSubscribed(self, presence):
     signals.getSignals().unsubs_in.emit(str(presence['from']))
Exemplo n.º 16
0
 def muc_offline(self, presence):
     signals.getSignals().muc_contact_offline.emit(presence)
Exemplo n.º 17
0
 def subscribe_to_contact(self, to):
     self.send_presence(pto=to, ptype='subscribe')
     signals.getSignals().rosterChanged.emit([to])
Exemplo n.º 18
0
 def muc_offline(self, presence):
     signals.getSignals().muc_contact_offline.emit(presence)