comparison sat/plugins/plugin_xep_0277.py @ 3179:84a94b385760

bridge: messageSend's extra is now serialised
author Goffi <goffi@goffi.org>
date Fri, 21 Feb 2020 12:17:38 +0100
parents 559a625a236b
children 384283adcce1
comparison
equal deleted inserted replaced
3178:98b321234068 3179:84a94b385760
1 #!/usr/bin/env python3 1 #!/usr/bin/env python3
2
3 2
4 # SAT plugin for microblogging over XMPP (xep-0277) 3 # SAT plugin for microblogging over XMPP (xep-0277)
5 # Copyright (C) 2009-2020 Jérôme Poisson (goffi@goffi.org) 4 # Copyright (C) 2009-2020 Jérôme Poisson (goffi@goffi.org)
6 5
7 # This program is free software: you can redistribute it and/or modify 6 # This program is free software: you can redistribute it and/or modify
19 18
20 from sat.core.i18n import _ 19 from sat.core.i18n import _
21 from sat.core.constants import Const as C 20 from sat.core.constants import Const as C
22 from sat.core.log import getLogger 21 from sat.core.log import getLogger
23 22
24 log = getLogger(__name__)
25 from twisted.words.protocols.jabber import jid, error 23 from twisted.words.protocols.jabber import jid, error
26 from twisted.words.protocols.jabber.xmlstream import XMPPHandler 24 from twisted.words.protocols.jabber.xmlstream import XMPPHandler
27 from twisted.words.xish import domish 25 from twisted.words.xish import domish
28 from twisted.internet import defer 26 from twisted.internet import defer
29 from twisted.python import failure 27 from twisted.python import failure
41 import shortuuid 39 import shortuuid
42 import time 40 import time
43 import dateutil 41 import dateutil
44 import calendar 42 import calendar
45 import urllib.parse 43 import urllib.parse
44
45 log = getLogger(__name__)
46
46 47
47 NS_MICROBLOG = "urn:xmpp:microblog:0" 48 NS_MICROBLOG = "urn:xmpp:microblog:0"
48 NS_ATOM = "http://www.w3.org/2005/Atom" 49 NS_ATOM = "http://www.w3.org/2005/Atom"
49 NS_PUBSUB_EVENT = "{}{}".format(pubsub.NS_PUBSUB, "#event") 50 NS_PUBSUB_EVENT = "{}{}".format(pubsub.NS_PUBSUB, "#event")
50 NS_COMMENT_PREFIX = "{}:comments/".format(NS_MICROBLOG) 51 NS_COMMENT_PREFIX = "{}:comments/".format(NS_MICROBLOG)