Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
l-n-s
gajim
Commits
94160d83
Commit
94160d83
authored
6 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
Adapt to AffiliationResult changes in nbxmpp
parent
f8373012
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gajim/gtk/groupchat_config.py
+14
-12
14 additions, 12 deletions
gajim/gtk/groupchat_config.py
with
14 additions
and
12 deletions
gajim/gtk/groupchat_config.py
+
14
−
12
View file @
94160d83
...
...
@@ -15,6 +15,7 @@
import
logging
import
nbxmpp
from
nbxmpp.util
import
is_error_result
from
gi.repository
import
Gdk
from
gi.repository
import
Gtk
...
...
@@ -65,7 +66,8 @@ class GroupchatConfig(Gtk.ApplicationWindow):
con
.
get_module
(
'
MUC
'
).
get_affiliation
(
self
.
jid
,
affiliation
,
callback
=
self
.
_on_affiliations_received
)
callback
=
self
.
_on_affiliations_received
,
user_data
=
affiliation
)
if
form
is
not
None
:
self
.
_ui
.
stack
.
set_visible_child_name
(
'
config
'
)
...
...
@@ -352,28 +354,28 @@ class GroupchatConfig(Gtk.ApplicationWindow):
con
.
get_module
(
'
MUC
'
).
set_affiliation
(
self
.
jid
,
diff_dict
)
@ensure_not_destroyed
def
_on_affiliations_received
(
self
,
result
):
if
result
.
is_error
:
def
_on_affiliations_received
(
self
,
result
,
affiliation
):
if
is_error
_result
(
result
)
:
log
.
info
(
'
Error while requesting %s affiliations: %s
'
,
result
.
affiliation
,
result
.
error
)
affiliation
,
result
)
return
if
result
.
affiliation
==
'
outcast
'
:
if
affiliation
==
'
outcast
'
:
self
.
_ui
.
stack
.
get_child_by_name
(
'
outcast
'
).
show
()
for
jid
,
attrs
in
result
.
users
.
items
():
affiliation_edit
,
jid_edit
=
self
.
_allowed_to_edit
(
result
.
affiliation
)
if
result
.
affiliation
==
'
outcast
'
:
affiliation_edit
,
jid_edit
=
self
.
_allowed_to_edit
(
affiliation
)
if
affiliation
==
'
outcast
'
:
reason
=
attrs
.
get
(
'
reason
'
)
self
.
_ui
.
outcast_store
.
append
(
[
jid
,
reason
,
None
,
result
.
affiliation
,
affiliation
,
None
,
affiliation_edit
,
jid_edit
])
self
.
_affiliations
[
jid
]
=
{
'
affiliation
'
:
result
.
affiliation
,
self
.
_affiliations
[
jid
]
=
{
'
affiliation
'
:
affiliation
,
'
reason
'
:
reason
}
else
:
nick
=
attrs
.
get
(
'
nick
'
)
...
...
@@ -382,11 +384,11 @@ class GroupchatConfig(Gtk.ApplicationWindow):
[
jid
,
nick
,
role
,
result
.
affiliation
,
_
(
result
.
affiliation
.
capitalize
()),
affiliation
,
_
(
affiliation
.
capitalize
()),
affiliation_edit
,
jid_edit
])
self
.
_affiliations
[
jid
]
=
{
'
affiliation
'
:
result
.
affiliation
,
self
.
_affiliations
[
jid
]
=
{
'
affiliation
'
:
affiliation
,
'
nick
'
:
nick
}
if
role
is
not
None
:
self
.
_ui
.
role_column
.
set_visible
(
True
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment