Exemplo n.º 1
0
    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
Exemplo n.º 2
0
    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
Exemplo n.º 3
0
    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
Exemplo n.º 4
0
    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
Exemplo n.º 5
0
    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
Exemplo n.º 6
0
    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
Exemplo n.º 7
0
    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)
Exemplo n.º 8
0
    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)
Exemplo n.º 9
0
    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
Exemplo n.º 10
0
    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)
Exemplo n.º 11
0
    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)