summaryrefslogtreecommitdiff
path: root/sleekxmpp/basexmpp.py
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@netflint.net>2009-09-05 07:38:29 +0000
committerNathan Fritz <fritzy@netflint.net>2009-09-05 07:38:29 +0000
commitcb360c94797252291e2016bdc655063dd4670c66 (patch)
tree2bbe517bf05fddd0b1db5913169a51123f5f7f99 /sleekxmpp/basexmpp.py
parent5593848490e5826ad07da591304ce6e67eb3afb5 (diff)
downloadslixmpp-cb360c94797252291e2016bdc655063dd4670c66.tar.gz
slixmpp-cb360c94797252291e2016bdc655063dd4670c66.tar.bz2
slixmpp-cb360c94797252291e2016bdc655063dd4670c66.tar.xz
slixmpp-cb360c94797252291e2016bdc655063dd4670c66.zip
* fixes
Diffstat (limited to 'sleekxmpp/basexmpp.py')
-rw-r--r--sleekxmpp/basexmpp.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py
index e120a71a..965570ed 100644
--- a/sleekxmpp/basexmpp.py
+++ b/sleekxmpp/basexmpp.py
@@ -264,7 +264,7 @@ class basexmpp(object):
with self.lock:
self.event_handlers[name].pop(self.event_handlers[name].index(handler))
- def makeMessage(self, mto, mbody='', msubject=None, mtype=None, mhtml=None, mfrom=None):
+ def makeMessage(self, mto, mbody='', msubject=None, mtype=None, mhtml=None, mfrom=None, mnick=None):
message = ET.Element('{%s}message' % self.default_ns)
if mfrom is None:
message.attrib['from'] = self.fulljid
@@ -289,6 +289,11 @@ class basexmpp(object):
subject = ET.Element('subject')
subject.text = msubject
message.append(subject)
+ if mnick:
+ print("generating nick")
+ nick = ET.Element("{http://jabber.org/protocol/nick}nick")
+ nick.text = mnick
+ message.append(nick)
return message
def makePresence(self, pshow=None, pstatus=None, ppriority=None, pto=None, ptype=None, pfrom=None):
@@ -315,8 +320,8 @@ class basexmpp(object):
presence.attrib['from'] = pfrom
return presence
- def sendMessage(self, mto, mbody, msubject=None, mtype=None, mhtml=None, mfrom=None):
- self.send(self.makeMessage(mto,mbody,msubject,mtype,mhtml,mfrom))
+ def sendMessage(self, mto, mbody, msubject=None, mtype=None, mhtml=None, mfrom=None, mnick=None):
+ self.send(self.makeMessage(mto,mbody,msubject,mtype,mhtml,mfrom,mnick))
def sendPresence(self, pshow=None, pstatus=None, ppriority=None, pto=None, pfrom=None):
self.send(self.makePresence(pshow,pstatus,ppriority,pto, pfrom=pfrom))