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
Weblate
gajim
Commits
c797a14b
Commit
c797a14b
authored
16 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
fix listing and leaving groupchats from adhoc commands. Fixes #4344
parent
22cc993f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/commands.py
+10
-4
10 additions, 4 deletions
src/common/commands.py
src/message_window.py
+4
-3
4 additions, 3 deletions
src/message_window.py
with
14 additions
and
7 deletions
src/common/commands.py
+
10
−
4
View file @
c797a14b
...
...
@@ -158,7 +158,8 @@ def find_current_groupchats(account):
import
message_control
rooms
=
[]
for
gc_control
in
gajim
.
interface
.
msg_win_mgr
.
get_controls
(
message_control
.
TYPE_GC
):
message_control
.
TYPE_GC
)
+
gajim
.
interface
.
minimized_controls
[
account
].
\
values
():
acct
=
gc_control
.
account
# check if account is the good one
if
acct
!=
account
:
...
...
@@ -224,8 +225,7 @@ class LeaveGroupchatsCommand(AdHocCommand):
try
:
gc
=
form
[
'
groupchats
'
].
values
except
:
# KeyError if there's no presence-type field in form or
# AttributeError if that field is of wrong type
except
:
# KeyError if there's no groupchats in form
self
.
badRequest
(
request
)
return
False
account
=
self
.
connection
.
name
...
...
@@ -233,8 +233,14 @@ class LeaveGroupchatsCommand(AdHocCommand):
for
room_jid
in
gc
:
gc_control
=
gajim
.
interface
.
msg_win_mgr
.
get_gc_control
(
room_jid
,
account
)
if
not
gc_control
:
gc_control
=
gajim
.
interface
.
minimized_controls
[
account
]
\
[
room_jid
]
gc_control
.
shutdown
()
gajim
.
interface
.
roster
.
remove_groupchat
(
room_jid
,
account
)
continue
gc_control
.
parent_win
.
remove_tab
(
gc_control
,
None
,
force
=
True
)
except
:
# KeyError if there's no
presence-type field in form or
except
:
# KeyError if there's no
such room opened
self
.
badRequest
(
request
)
return
False
response
,
cmd
=
self
.
buildResponse
(
request
,
status
=
'
completed
'
)
...
...
This diff is collapsed.
Click to expand it.
src/message_window.py
+
4
−
3
View file @
c797a14b
...
...
@@ -514,8 +514,6 @@ class MessageWindow(object):
close
(
ctrl
)
def
on_no
(
ctrl
):
if
not
force
:
return
close
(
ctrl
)
def
on_minimize
(
ctrl
):
...
...
@@ -526,7 +524,10 @@ class MessageWindow(object):
close
(
ctrl
)
# Shutdown the MessageControl
ctrl
.
allow_shutdown
(
method
,
on_yes
,
on_no
,
on_minimize
)
if
force
:
close
(
ctrl
)
else
:
ctrl
.
allow_shutdown
(
method
,
on_yes
,
on_no
,
on_minimize
)
def
check_tabs
(
self
):
if
self
.
get_num_controls
()
==
0
:
...
...
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