Esempio n. 1
0
 def msg_send(self, mto, mbody, mfrom=None, mnick=None, **kwargs):
     """
     Create message and send it.
     """
     return OutgoingLudolphMessage.create(mbody, **kwargs).send(self,
                                                                mto,
                                                                mfrom=mfrom,
                                                                mnick=mnick)
Esempio n. 2
0
    def msg_resend(self, msg, **kwargs):
        """
        Re-send message to original recipient with optional delay.
        """
        defaults = {"mtype": msg.get("mtype", None), "msubject": msg.get("subject", None)}
        defaults.update(kwargs)

        return OutgoingLudolphMessage.create(msg["body"], **kwargs).send(self, msg["from"], mfrom=msg["to"])
Esempio n. 3
0
    def msg_reply(self, msg, mbody, preserve_msg=False, **kwargs):
        """
        Set message reply text and html, and send it.
        """
        if mbody is None:
            return None  # Command performs custom message sending

        if preserve_msg:
            msg = self.msg_copy(msg)

        return OutgoingLudolphMessage.create(mbody, **kwargs).reply(msg)
Esempio n. 4
0
    def msg_reply(self, msg, mbody, preserve_msg=False, **kwargs):
        """
        Set message reply text and html, and send it.
        """
        if mbody is None:
            return None  # Command performs custom message sending

        if preserve_msg:
            msg = self.msg_copy(msg)

        return OutgoingLudolphMessage.create(mbody, **kwargs).reply(msg)
Esempio n. 5
0
    def msg_broadcast(self, mbody, **kwargs):
        """
        Send message to all users in roster.
        """
        msg = OutgoingLudolphMessage.create(mbody, **kwargs)
        i = 0

        for jid in self.client_roster:
            if not (jid == self.boundjid.bare or jid in self.broadcast_blacklist):
                msg.send(self, jid)
                i += 1

        return i
Esempio n. 6
0
    def msg_broadcast(self, mbody, **kwargs):
        """
        Send message to all users in roster.
        """
        msg = OutgoingLudolphMessage.create(mbody, **kwargs)
        i = 0

        for jid in self.client_roster:
            if not (jid == self.boundjid.bare
                    or jid in self.broadcast_blacklist):
                msg.send(self, jid)
                i += 1

        return i
Esempio n. 7
0
    def msg_resend(self, msg, **kwargs):
        """
        Re-send message to original recipient with optional delay.
        """
        defaults = {
            'mtype': msg.get('mtype', None),
            'msubject': msg.get('subject', None)
        }
        defaults.update(kwargs)

        return OutgoingLudolphMessage.create(msg['body'],
                                             **kwargs).send(self,
                                                            msg['from'],
                                                            mfrom=msg['to'])
Esempio n. 8
0
 def msg_send(self, mto, mbody, mfrom=None, mnick=None, **kwargs):
     """
     Create message and send it.
     """
     return OutgoingLudolphMessage.create(mbody, **kwargs).send(self, mto, mfrom=mfrom, mnick=mnick)