コード例 #1
0
ファイル: postmen.py プロジェクト: bellyfat/Murmeli
 def broadcastOnlineStatus(self):
     '''Queue a status notification message for each of our trusted contacts'''
     print("Outgoing postman is broadcasting the status...")
     self._broadcasting = True
     profileList = DbI.getTrustedProfiles()
     if profileList:
         msg = StatusNotifyMessage(online=True, ping=True, profileHash=None)
         msg.recipients = [c['torid'] for c in profileList]
         DbI.addToOutbox(msg)
     self._broadcasting = False
     self.flushSignal.emit()
コード例 #2
0
ファイル: postmen.py プロジェクト: activityworkshop/Murmeli
	def broadcastOnlineStatus(self):
		'''Queue a status notification message for each of our trusted contacts'''
		print("Outgoing postman is broadcasting the status...")
		self._broadcasting = True
		profileList = DbClient.getContactList("trusted")
		if profileList:
			msg = StatusNotifyMessage(online=True, ping=True, profileHash=None)
			msg.recipients = [c['torid'] for c in profileList]
			DbClient.addMessageToOutbox(msg)
		self._broadcasting = False
		self.flushSignal.emit()
コード例 #3
0
	def keyFingerprintChecked(torId):
		'''The fingerprint of this contact's public key has been checked (over a separate channel)'''
		# Check that userid exists and that status is currently "untrusted" (trusted also doesn't hurt)
		profile = DbClient.getProfile(torId, False)
		if profile and profile.get("status", "nostatus") in ["untrusted", "trusted"]:
			# Update the user's status to trusted
			DbClient.updateContact(torId, {"status" : "trusted"})
			# Trigger a StatusNotify to tell them we're online
			notify = StatusNotifyMessage(online=True, ping=True, profileHash=None)
			notify.recipients = [torId]
			DbClient.addMessageToOutbox(notify)
コード例 #4
0
ファイル: contactmgr.py プロジェクト: bellyfat/Murmeli
 def keyFingerprintChecked(torId):
     '''The fingerprint of this contact's public key has been checked (over a separate channel)'''
     # Check that userid exists and that status is currently "untrusted" (trusted also doesn't hurt)
     profile = DbI.getProfile(torId)
     if profile and profile["status"] in ["untrusted", "trusted"]:
         # Update the user's status to trusted
         DbI.updateProfile(torId, {"status": "trusted"})
         # Trigger a StatusNotify to tell them we're online
         notify = StatusNotifyMessage(online=True,
                                      ping=True,
                                      profileHash=None)
         notify.recipients = [torId]
         DbI.addToOutbox(notify)