Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gajim
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
255
Issues
255
List
Board
Labels
Milestones
Merge Requests
10
Merge Requests
10
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gajim
gajim
Commits
46707606
Commit
46707606
authored
Jan 19, 2019
by
Philipp Hörist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix destroying a MUC
- Only close the tab if we initiated the destruction
parent
31d9b397
Pipeline
#2983
passed with stages
in 3 minutes and 28 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
12 deletions
+26
-12
bookmarks.py
gajim/common/modules/bookmarks.py
+12
-2
muc.py
gajim/common/modules/muc.py
+1
-1
groupchat_control.py
gajim/groupchat_control.py
+13
-6
bookmarks.py
gajim/gtk/bookmarks.py
+0
-3
No files found.
gajim/common/modules/bookmarks.py
View file @
46707606
...
...
@@ -286,6 +286,9 @@ class Bookmarks(AbstractPEPModule):
else
:
self
.
_private_store
(
storage_node
)
app
.
nec
.
push_incoming_event
(
NetworkEvent
(
'bookmarks-received'
,
account
=
self
.
_account
))
def
_pubsub_store
(
self
,
storage_node
:
nbxmpp
.
Node
)
->
None
:
self
.
_con
.
get_module
(
'PubSub'
)
.
send_pb_publish
(
''
,
'storage:bookmarks'
,
storage_node
,
'current'
,
...
...
@@ -344,8 +347,12 @@ class Bookmarks(AbstractPEPModule):
}
self
.
store_bookmarks
()
app
.
nec
.
push_incoming_event
(
NetworkEvent
(
'bookmarks-received'
,
account
=
self
.
_account
))
def
remove
(
self
,
jid
:
str
,
publish
:
bool
=
True
)
->
None
:
if
self
.
bookmarks
.
pop
(
jid
,
None
)
is
None
:
return
if
publish
:
self
.
store_bookmarks
()
def
get_name_from_bookmark
(
self
,
jid
:
str
)
->
str
:
fallback
=
jid
.
split
(
'@'
)[
0
]
...
...
@@ -354,6 +361,9 @@ class Bookmarks(AbstractPEPModule):
except
KeyError
:
return
fallback
def
is_bookmark
(
self
,
jid
:
str
)
->
bool
:
return
jid
in
self
.
bookmarks
def
purge_pubsub_bookmarks
(
self
)
->
None
:
log
.
info
(
'Purge/Delete Bookmarks on PubSub, '
'because publish options are not available'
)
...
...
gajim/common/modules/muc.py
View file @
46707606
...
...
@@ -84,7 +84,7 @@ class MUC:
'cancel_config'
,
'send_captcha'
,
'decline'
,
'request_voice'
'request_voice'
,
'destroy'
,
]
...
...
gajim/groupchat_control.py
View file @
46707606
...
...
@@ -182,6 +182,9 @@ class GroupchatControl(ChatControlBase):
# if True, the room has mentioned us
self
.
attention_flag
=
False
# True if we initiated room destruction
self
.
_wait_for_destruction
=
False
# sorted list of nicks who mentioned us (last at the end)
self
.
attention_list
=
[]
self
.
nick_hits
=
[]
...
...
@@ -651,14 +654,10 @@ class GroupchatControl(ChatControlBase):
_
(
'Invalid group chat JID'
),
_
(
'The group chat JID has not allowed characters.'
))
return
self
.
_wait_for_destruction
=
True
con
=
app
.
connections
[
self
.
account
]
con
.
get_module
(
'MUC'
)
.
destroy
(
self
.
room_jid
,
reason
,
jid
)
con
.
get_module
(
'Bookmarks'
)
.
bookmarks
.
pop
(
self
.
room_jid
,
None
)
con
.
get_module
(
'Bookmarks'
)
.
store_bookmarks
()
gui_menu_builder
.
build_bookmark_menu
(
self
.
account
)
self
.
force_non_minimizable
=
True
self
.
parent_win
.
remove_tab
(
self
,
self
.
parent_win
.
CLOSE_COMMAND
)
self
.
force_non_minimizable
=
False
# Ask for a reason
DoubleInputDialog
(
_
(
'Destroying
%
s'
)
%
'
\u200E
'
+
\
...
...
@@ -2227,6 +2226,14 @@ class GroupchatControl(ChatControlBase):
self
.
autorejoin
=
False
self
.
got_disconnected
()
con
=
app
.
connections
[
self
.
account
]
con
.
get_module
(
'Bookmarks'
)
.
remove
(
self
.
room_jid
)
if
self
.
_wait_for_destruction
:
self
.
force_non_minimizable
=
True
self
.
parent_win
.
remove_tab
(
self
,
self
.
parent_win
.
CLOSE_COMMAND
)
self
.
force_non_minimizable
=
False
def
get_role_iter
(
self
,
role
:
str
)
->
Optional
[
Gtk
.
TreeIter
]:
try
:
ref
=
self
.
_role_refs
[
role
]
...
...
gajim/gtk/bookmarks.py
View file @
46707606
...
...
@@ -21,8 +21,6 @@ from gajim.common import app
from
gajim.common
import
helpers
from
gajim.common.i18n
import
_
from
gajim
import
gui_menu_builder
from
gajim.gtk.dialogs
import
ErrorDialog
from
gajim.gtk.util
import
get_builder
...
...
@@ -207,7 +205,6 @@ class ManageBookmarksWindow:
con
.
get_module
(
'Bookmarks'
)
.
bookmarks
[
jid
]
=
bmdict
con
.
get_module
(
'Bookmarks'
)
.
store_bookmarks
()
gui_menu_builder
.
build_bookmark_menu
(
acct
)
self
.
window
.
destroy
()
def
on_cancel_button_clicked
(
self
,
widget
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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