def reply(self, body=None, clear=True): """ Create a message reply. Overrides StanzaBase.reply. Sets proper 'to' attribute if the message is from a MUC, and adds a message body if one is given. Arguments: body -- Optional text content for the message. clear -- Indicates if existing content should be removed before replying. Defaults to True. """ thread = self['thread'] parent = self['parent_thread'] StanzaBase.reply(self, clear) if self['type'] == 'groupchat': self['to'] = self['to'].bare self['thread'] = thread self['parent_thread'] = parent del self['id'] if body is not None: self['body'] = body return self
def reply(self): """ Send a reply <iq> stanza. Overrides StanzaBase.reply Sets the 'type' to 'result' in addition to the default StanzaBase.reply behavior. """ self['type'] = 'result' StanzaBase.reply(self) return self
def reply(self, clear=True): """ Send a reply <iq> stanza. Overrides StanzaBase.reply Sets the 'type' to 'result' in addition to the default StanzaBase.reply behavior. Arguments: clear -- Indicates if existing content should be removed before replying. Defaults to True. """ self['type'] = 'result' StanzaBase.reply(self, clear) return self
def reply(self): """ Set the appropriate presence reply type. Overrides StanzaBase.reply. """ if self['type'] == 'unsubscribe': self['type'] = 'unsubscribed' elif self['type'] == 'subscribe': self['type'] = 'subscribed' return StanzaBase.reply(self)
def reply(self, body=None): """ Create a message reply. Overrides StanzaBase.reply. Sets proper 'to' attribute if the message is from a MUC, and adds a message body if one is given. Arguments: body -- Optional text content for the message. """ StanzaBase.reply(self) if self['type'] == 'groupchat': self['to'] = self['to'].bare del self['id'] if body is not None: self['body'] = body return self
def reply(self, clear=True): """ Set the appropriate presence reply type. Overrides StanzaBase.reply. Arguments: clear -- Indicates if the stanza contents should be removed before replying. Defaults to True. """ if self['type'] == 'unsubscribe': self['type'] = 'unsubscribed' elif self['type'] == 'subscribe': self['type'] = 'subscribed' return StanzaBase.reply(self, clear)