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
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)
def received(self, addr, msg=''): tag = c.IPMSG_RECVMSG engine.send(addr, tag, msg)
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())
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())
def req_pubkey(self, addr): tag = c.IPMSG_GETPUBKEY msg = shex(cry.encrypt_capa) engine.send(addr, tag, msg)
def response_readmsg(self, p): addr = p.addr tag = c.IPMSG_READMSG | c.IPMSG_READCHECKOPT msg = p.cntr engine.send(addr, tag, msg)
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)
def rsps_getabsenceinfo(self, p, contact): tag = c.IPMSG_SENDABSENCEINFO msg = self.auto_reply_msg engine.send(contact.addr, tag, msg)
def rsps_sendabsenceinfo(self, p, contact): tag = c.IPMSG_GETABSENCEINFO engine.send(contact.addr, tag)
def rsps_getinfo(self, p, contact): tag = c.IPMSG_SENDINFO msg = util.utf8_to_sjis(c.PROTOCOL_VERSION) engine.send(contact.addr, tag, msg)