Beispiel #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')
Beispiel #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')
Beispiel #3
0
 def onOffline(self, presence):
     if 'conference' in str(presence['from']):
         return
     else:
         signals.getSignals().contact_offline.emit(presence)
Beispiel #4
0
 def onDisconnect(self, event):
     self.connected = False
     signals.getSignals().disconnected.emit()
Beispiel #5
0
 def onAuthFailed(self, event):
     signals.getSignals().auth_failed.emit()
Beispiel #6
0
 def onMessage(self, message):
     if str(message['from']).split('/')[0] not in self.client_roster:
         return
     signals.getSignals().message_received.emit(message)
Beispiel #7
0
 def onStart(self, event):
     self.send_presence()
     self.get_roster()
     signals.getSignals().session_start.emit(self.client_roster)
Beispiel #8
0
 def onUnSubscribed(self, presence):
     signals.getSignals().unsubs_in.emit(str(presence['from']))
Beispiel #9
0
 def subscribe_to_contact(self, to):
     self.send_presence(pto=to, ptype='subscribe')
     signals.getSignals().rosterChanged.emit([to])
Beispiel #10
0
 def onDisconnect(self, event):
     self.connected = False
     signals.getSignals().disconnected.emit()
Beispiel #11
0
 def onOffline(self, presence):
     if 'conference' in str(presence['from']):
         return
     else:
         signals.getSignals().contact_offline.emit(presence)
Beispiel #12
0
 def onAuthFailed(self, event):
     signals.getSignals().auth_failed.emit()
Beispiel #13
0
 def onMessage(self, message):
     if str(message['from']).split('/')[0] not in self.client_roster:
         return
     signals.getSignals().message_received.emit(message)
Beispiel #14
0
 def onStart(self, event):
     self.send_presence()
     self.get_roster()
     signals.getSignals().session_start.emit(self.client_roster)
Beispiel #15
0
 def onUnSubscribed(self, presence):
     signals.getSignals().unsubs_in.emit(str(presence['from']))
Beispiel #16
0
 def muc_offline(self, presence):
     signals.getSignals().muc_contact_offline.emit(presence)
Beispiel #17
0
 def subscribe_to_contact(self, to):
     self.send_presence(pto=to, ptype='subscribe')
     signals.getSignals().rosterChanged.emit([to])
Beispiel #18
0
 def muc_offline(self, presence):
     signals.getSignals().muc_contact_offline.emit(presence)