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
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor 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
mesonium
gajim
Commits
20cb0f09
Commit
20cb0f09
authored
5 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
StartChat: Handle <gone> error better
- Show reason when group chat is gone - Follow redirect if one exists
parent
674e5ab2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gajim/gtk/start_chat.py
+17
-1
17 additions, 1 deletion
gajim/gtk/start_chat.py
with
17 additions
and
1 deletion
gajim/gtk/start_chat.py
+
17
−
1
View file @
20cb0f09
...
...
@@ -28,7 +28,9 @@
from
gajim.common.helpers
import
validate_jid
from
gajim.common.helpers
import
to_user_string
from
gajim.common.helpers
import
get_groupchat_name
from
gajim.common.helpers
import
get_alternative_venue
from
gajim.common.i18n
import
_
from
gajim.common.i18n
import
get_rfc5646_lang
from
gajim.common.const
import
AvatarSize
from
gajim.common.const
import
MUC_DISCO_ERRORS
...
...
@@ -57,6 +59,7 @@ def __init__(self):
self
.
_keywords
=
[]
self
.
_destroyed
=
False
self
.
_search_stopped
=
False
self
.
_redirected
=
False
self
.
_ui
=
get_builder
(
'
start_chat_dialog.ui
'
)
self
.
add
(
self
.
_ui
.
stack
)
...
...
@@ -257,6 +260,7 @@ def _start_new_chat(self, row):
return
self
.
ready_to_destroy
=
False
self
.
_redirected
=
False
self
.
_disco_muc
(
row
.
account
,
row
.
jid
)
else
:
...
...
@@ -272,7 +276,13 @@ def _disco_muc(self, account, jid):
@ensure_not_destroyed
def
_disco_info_received
(
self
,
account
,
result
):
if
is_error_result
(
result
):
self
.
_set_error
(
result
)
jid
=
get_alternative_venue
(
result
)
if
jid
is
None
or
self
.
_redirected
:
self
.
_set_error
(
result
)
return
self
.
_redirected
=
True
self
.
_disco_muc
(
account
,
jid
)
elif
result
.
is_muc
:
self
.
_muc_info_box
.
set_account
(
account
)
...
...
@@ -284,6 +294,10 @@ def _disco_info_received(self, account, result):
def
_set_error
(
self
,
error
):
text
=
MUC_DISCO_ERRORS
.
get
(
error
.
condition
,
to_user_string
(
error
))
if
error
.
condition
==
'
gone
'
:
reason
=
error
.
get_text
(
get_rfc5646_lang
())
if
reason
:
text
=
'
%s:
\n
%s
'
%
(
text
,
reason
)
self
.
_show_error_page
(
text
)
def
_set_error_from_code
(
self
,
error_code
):
...
...
@@ -319,6 +333,8 @@ def _on_select_clicked(self, *args):
self
.
_show_error_page
(
_
(
'
You can not join a group chat
'
'
unless you are connected.
'
))
return
self
.
_redirected
=
False
self
.
_disco_muc
(
account
,
selected_row
.
jid
)
def
_set_listbox
(
self
,
listbox
):
...
...
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