Commit 72df7958 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Bookmarks: Add extensions support

parent cd1c3a3c
Pipeline #8425 failed with stages
in 2 minutes and 37 seconds
......@@ -63,12 +63,14 @@ def parse_bookmark(item):
nick = parse_nickname(conference.getTagData('nick'))
name = conference.getAttr('name') or None
password = conference.getTagData('password') or None
extensions = conference.getTag('extensions')
return BookmarkData(jid=jid,
name=name,
nick=nick,
autojoin=autojoin,
password=password,
nick=nick)
extensions=extensions)
def parse_bookmarks(item, log):
......@@ -127,6 +129,8 @@ def build_conference_node(bookmark):
conference = Node(tag='conference', attrs=attrs)
if bookmark.nick:
conference.setTagData('nick', bookmark.nick)
if bookmark.extensions is not None:
conference.addChild(node=bookmark.extensions)
return conference
......
......@@ -88,6 +88,15 @@ class BobData(NamedTuple):
type: str
class BookmarkData(NamedTuple):
jid: JID
name: Optional[str] = None
nick: Optional[str] = None
autojoin: bool = False
password: Optional[str] = None
extensions: Optional[Node] = None
VoiceRequest = namedtuple('VoiceRequest', 'form jid nick')
MucUserData = namedtuple('MucUserData', 'affiliation jid nick role actor reason')
......@@ -122,9 +131,6 @@ ActivityData = namedtuple('ActivityData', 'activity subactivity text')
LocationData = namedtuple('LocationData', LOCATION_DATA)
LocationData.__new__.__defaults__ = (None,) * len(LocationData._fields)
BookmarkData = namedtuple('BookmarkData', 'jid name nick autojoin password')
BookmarkData.__new__.__defaults__ = (None, None, None, None)
PGPPublicKey = namedtuple('PGPPublicKey', 'jid key date')
PGPKeyMetadata = namedtuple('PGPKeyMetadata', 'jid fingerprint date')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment