Blasta/blasta/xmpp/message.py
Schimon Jehudah, Adv. 77ac4c0ed9 Modularize code;
Update document README.
2024-11-13 16:41:33 +02:00

22 lines
651 B
Python

#!/usr/bin/python
# -*- coding: utf-8 -*-
class XmppMessage:
def send(self, jid, message_body):
jid_from = str(self.boundjid) if self.is_component else None
self.send_message(
mto=jid,
mfrom=jid_from,
mbody=message_body,
mtype='chat')
# NOTE It appears to not work.
def send_headline(self, jid, message_subject, message_body):
jid_from = str(self.boundjid) if self.is_component else None
self.send_message(
mto=jid,
mfrom=jid_from,
msubject=message_subject,
mbody=message_body,
mtype='headline')