summaryrefslogtreecommitdiff
path: root/sleekxmpp/stanza/message.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-02-14 16:26:23 -0500
committerLance Stout <lancestout@gmail.com>2011-02-14 16:26:23 -0500
commitd5b3a5282763e4f74816ff392bd8cd47dd9f7a95 (patch)
tree10b421c0cf9cf47997162485f35dabdccfffab69 /sleekxmpp/stanza/message.py
parent1a270dc05cc368000f3545975befa0589031b684 (diff)
parentd709f8db657aa1d1314082d842dd29e2546739c4 (diff)
downloadslixmpp-d5b3a5282763e4f74816ff392bd8cd47dd9f7a95.tar.gz
slixmpp-d5b3a5282763e4f74816ff392bd8cd47dd9f7a95.tar.bz2
slixmpp-d5b3a5282763e4f74816ff392bd8cd47dd9f7a95.tar.xz
slixmpp-d5b3a5282763e4f74816ff392bd8cd47dd9f7a95.zip
Merge branch 'develop' into stream_features
Conflicts: sleekxmpp/xmlstream/stanzabase.py
Diffstat (limited to 'sleekxmpp/stanza/message.py')
-rw-r--r--sleekxmpp/stanza/message.py38
1 files changed, 15 insertions, 23 deletions
diff --git a/sleekxmpp/stanza/message.py b/sleekxmpp/stanza/message.py
index 66c74d8a..cb3d344c 100644
--- a/sleekxmpp/stanza/message.py
+++ b/sleekxmpp/stanza/message.py
@@ -63,27 +63,6 @@ class Message(RootStanza):
plugin_attrib = name
types = set((None, 'normal', 'chat', 'headline', 'error', 'groupchat'))
- def setup(self, xml=None):
- """
- Populate the stanza object using an optional XML object.
-
- Overrides StanzaBase.setup.
-
- Arguments:
- xml -- Use an existing XML object for the stanza's values.
- """
- # To comply with PEP8, method names now use underscores.
- # Deprecated method names are re-mapped for backwards compatibility.
- self.getType = self.get_type
- self.getMucroom = self.get_mucroom
- self.setMucroom = self.set_mucroom
- self.delMucroom = self.del_mucroom
- self.getMucnick = self.get_mucnick
- self.setMucnick = self.set_mucnick
- self.delMucnick = self.del_mucnick
-
- return StanzaBase.setup(self, xml)
-
def get_type(self):
"""
Return the message type.
@@ -104,7 +83,7 @@ class Message(RootStanza):
self['type'] = 'normal'
return self
- def reply(self, body=None):
+ def reply(self, body=None, clear=True):
"""
Create a message reply.
@@ -114,7 +93,9 @@ class Message(RootStanza):
adds a message body if one is given.
Arguments:
- body -- Optional text content for the message.
+ body -- Optional text content for the message.
+ clear -- Indicates if existing content should be removed
+ before replying. Defaults to True.
"""
StanzaBase.reply(self)
if self['type'] == 'groupchat':
@@ -163,3 +144,14 @@ class Message(RootStanza):
def del_mucnick(self):
"""Dummy method to prevent deletion."""
pass
+
+
+# To comply with PEP8, method names now use underscores.
+# Deprecated method names are re-mapped for backwards compatibility.
+Message.getType = Message.get_type
+Message.getMucroom = Message.get_mucroom
+Message.setMucroom = Message.set_mucroom
+Message.delMucroom = Message.del_mucroom
+Message.getMucnick = Message.get_mucnick
+Message.setMucnick = Message.set_mucnick
+Message.delMucnick = Message.del_mucnick