示例#1
0
文件: handler.py 项目: yws/ipmsg
 def rsps_readmsg(self, p, contact):
     for msg in self.messages:
         if msg.io == 0 and msg.addr == p.addr and msg.get_cntr() == p.msg:
             msg.mark_open()
             if p.test(c.IPMSG_READCHECKOPT):
                 addr = p.addr
                 tag = c.IPMSG_ANSREADMSG
                 msg = p.cntr
                 engine.send(addr, tag, msg)
             return
示例#2
0
文件: handler.py 项目: yws/ipmsg
 def rsps_entry(self, p, contact):
     if not status.is_invisible() and not status.is_off() and contact.addr[0] not in engine.block_ips:
         tag = c.IPMSG_ANSENTRY
         if status.is_afk():
             tag |= c.IPMSG_ABSENCEOPT
         msg = engine.get_name_ext()
         if engine.supports_utf8(p.addr) or settings['always_use_utf8']:
             tag |= c.IPMSG_UTF8OPT
         else:
             msg = util.utf8_to_sjis(msg)
         engine.send(contact.addr, tag, msg)
     if not engine.is_self(contact.addr):
         self.events.add(contact)
     self.req_pubkey(contact.addr)
示例#3
0
文件: handler.py 项目: yws/ipmsg
 def received(self, addr, msg=''):
     tag = c.IPMSG_RECVMSG
     engine.send(addr, tag, msg)
示例#4
0
文件: handler.py 项目: yws/ipmsg
 def delete_notice(self, msg):
     for m in self.messages:
         if m == msg:
             m.mark_ignore()
             tag = c.IPMSG_DELMSG
             engine.send(m.addr, tag, m.get_cntr())
示例#5
0
文件: handler.py 项目: yws/ipmsg
 def open_notice(self, msg):
     for m in self.messages:
         if m == msg:
             m.mark_open()
             tag = c.IPMSG_READMSG
             engine.send(m.addr, tag, m.get_cntr())
示例#6
0
文件: handler.py 项目: yws/ipmsg
 def req_pubkey(self, addr):
     tag = c.IPMSG_GETPUBKEY
     msg = shex(cry.encrypt_capa)
     engine.send(addr, tag, msg)
示例#7
0
文件: handler.py 项目: yws/ipmsg
 def response_readmsg(self, p):
     addr = p.addr
     tag = c.IPMSG_READMSG | c.IPMSG_READCHECKOPT
     msg = p.cntr
     engine.send(addr, tag, msg)
示例#8
0
文件: handler.py 项目: yws/ipmsg
 def rsps_getpubkey(self, p, contact):
     addr = contact.addr
     cry.memo(addr, capa=p.msg)
     tag = c.IPMSG_ANSPUBKEY
     msg = cry.get_pubkey_raw(addr)
     engine.send(addr, tag, msg)
示例#9
0
文件: handler.py 项目: yws/ipmsg
 def rsps_getabsenceinfo(self, p, contact):
     tag = c.IPMSG_SENDABSENCEINFO
     msg = self.auto_reply_msg
     engine.send(contact.addr, tag, msg)
示例#10
0
文件: handler.py 项目: yws/ipmsg
 def rsps_sendabsenceinfo(self, p, contact):
     tag = c.IPMSG_GETABSENCEINFO
     engine.send(contact.addr, tag)
示例#11
0
文件: handler.py 项目: yws/ipmsg
 def rsps_getinfo(self, p, contact):
     tag = c.IPMSG_SENDINFO
     msg = util.utf8_to_sjis(c.PROTOCOL_VERSION)
     engine.send(contact.addr, tag, msg)