コード例 #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
コード例 #2
0
ファイル: message.py プロジェクト: 2M1R/SleekXMPP
    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
コード例 #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
コード例 #4
0
ファイル: iq.py プロジェクト: andyhelp/SleekXMPP
    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
コード例 #5
0
ファイル: iq.py プロジェクト: pnakos/my_project
    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
コード例 #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
コード例 #7
0
ファイル: presence.py プロジェクト: pombredanne/SleekXMPP
    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)
コード例 #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)
コード例 #9
0
ファイル: message.py プロジェクト: pombredanne/SleekXMPP
    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
コード例 #10
0
ファイル: presence.py プロジェクト: E-Tahta/sleekxmpp
    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)
コード例 #11
0
ファイル: presence.py プロジェクト: 2M1R/SleekXMPP
    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)