This repository has been archived by the owner on Feb 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #413 from mathieui/xep-0334
Implement XEP-0334 (message processing hints)
- Loading branch information
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
""" | ||
SleekXMPP: The Sleek XMPP Library | ||
Copyright (C) 2016 Nathanael C. Fritz, Lance J.T. Stout | ||
This file is part of SleekXMPP. | ||
See the file LICENSE for copying permission. | ||
""" | ||
|
||
from sleekxmpp.plugins.base import register_plugin | ||
|
||
from sleekxmpp.plugins.xep_0334.stanza import Store, NoStore, NoPermanentStore, NoCopy | ||
from sleekxmpp.plugins.xep_0334.hints import XEP_0334 | ||
|
||
register_plugin(XEP_0334) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
""" | ||
SleekXMPP: The Sleek XMPP Library | ||
Copyright (C) 2016 Nathanael C. Fritz, Lance J.T. Stout | ||
This file is part of SleekXMPP. | ||
See the file LICENSE for copying permission. | ||
""" | ||
|
||
import logging | ||
|
||
from sleekxmpp import Message | ||
from sleekxmpp.plugins import BasePlugin | ||
from sleekxmpp.xmlstream import register_stanza_plugin | ||
from sleekxmpp.plugins.xep_0334 import stanza, Store, NoStore, NoPermanentStore, NoCopy | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
class XEP_0334(BasePlugin): | ||
|
||
name = 'xep_0334' | ||
description = 'XEP-0334: Message Processing Hints' | ||
stanza = stanza | ||
|
||
def plugin_init(self): | ||
register_stanza_plugin(Message, Store) | ||
register_stanza_plugin(Message, NoStore) | ||
register_stanza_plugin(Message, NoPermanentStore) | ||
register_stanza_plugin(Message, NoCopy) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
""" | ||
SleekXMPP: The Sleek XMPP Library | ||
Implementation of Message Processing Hints | ||
http://xmpp.org/extensions/xep-0334.html | ||
Copyright (C) 2016 Nathanael C. Fritz, Lance J.T. Stout | ||
This file is part of SleekXMPP. | ||
See the file LICENSE for copying permission. | ||
""" | ||
|
||
from sleekxmpp.xmlstream import ElementBase | ||
|
||
class Store(ElementBase): | ||
name = 'store' | ||
plugin_attrib = 'store' | ||
namespace = 'urn:xmpp:hints' | ||
|
||
class NoPermanentStore(ElementBase): | ||
name = 'no-permanent-store' | ||
plugin_attrib = 'no-permanent-store' | ||
namespace = 'urn:xmpp:hints' | ||
|
||
class NoStore(ElementBase): | ||
name = 'no-store' | ||
plugin_attrib = 'no-store' | ||
namespace = 'urn:xmpp:hints' | ||
|
||
class NoCopy(ElementBase): | ||
name = 'no-copy' | ||
plugin_attrib = 'no-copy' | ||
namespace = 'urn:xmpp:hints' |