コード例 #1
0
 def doRememberTime(self, *args, **kwargs):
     """
     Action method.
     """
     to_be_remembered = True
     if self.latest_inbox_time:
         if utime.get_sec1970() - self.latest_inbox_time < 5 * 60:
             to_be_remembered = False
     if to_be_remembered:
         ratings.remember_connected_time(self.idurl.to_bin())
     self.latest_inbox_time = utime.get_sec1970()
コード例 #2
0
def Inbox(newpacket, info, status, message):
    """
    This is called when some ``packet`` was received from remote peer - user seems to be ONLINE.
    """
    global _ShutdownFlag
    if _ShutdownFlag:
        return False
    if newpacket.OwnerID == my_id.getLocalID():
        return False
    if newpacket.RemoteID != my_id.getLocalID():
        return False
    A(newpacket.OwnerID, 'inbox-packet', (newpacket, info, status, message))
    ratings.remember_connected_time(newpacket.OwnerID)
    return False