Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
poezio
slixmpp
Commits
2a76baf0
Verified
Commit
2a76baf0
authored
Aug 18, 2021
by
Maxime Buquet
Browse files
xep_0045: DictWrapper for self.rooms to help debug
Signed-off-by:
Maxime “pep” Buquet
<
pep@bouah.net
>
parent
d4067275
Changes
1
Hide whitespace changes
Inline
Side-by-side
slixmpp/plugins/xep_0045/muc.py
View file @
2a76baf0
...
...
@@ -62,6 +62,28 @@ AFFILIATIONS = ('outcast', 'member', 'admin', 'owner', 'none')
ROLES
=
(
'moderator'
,
'participant'
,
'visitor'
,
'none'
)
class
DictWrapper
(
dict
):
"""
Wrapper for XEP_0045.rooms dict to help pin-point issues related to poezio#3549.
https://lab.louiz.org/poezio/poezio/-/issues/3549
"""
def
__getitem__
(
self
,
val
):
if
hasattr
(
self
,
val
):
log
.
debug
(
'DictWrapper.__getitem__(%r): %r'
,
val
,
getattr
(
self
,
val
),
)
return
super
().
__getitem__
(
val
)
def
__delitem__
(
self
,
val
):
log
.
debug
(
'DictWrapper.__delitem__(%r)'
,
val
,
exc_info
=
True
,
)
return
super
().
__delitem__
(
val
)
class
XEP_0045
(
BasePlugin
):
"""
...
...
@@ -77,7 +99,7 @@ class XEP_0045(BasePlugin):
our_nicks
:
Dict
[
JID
,
str
]
def
plugin_init
(
self
):
self
.
rooms
=
{}
self
.
rooms
=
DictWrapper
()
self
.
our_nicks
=
{}
# load MUC support in presence stanzas
register_stanza_plugin
(
MUCMessage
,
MUCUserItem
)
...
...
Maxime Buquet
@ppjet
mentioned in issue
poezio#3555 (closed)
·
Sep 07, 2021
mentioned in issue
poezio#3555 (closed)
mentioned in issue poezio#3555
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment