Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gajim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
195
Issues
195
List
Boards
Labels
Service Desk
Milestones
Merge Requests
20
Merge Requests
20
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gajim
gajim
Commits
3d45a6e0
Commit
3d45a6e0
authored
Jun 22, 2019
by
Philipp Hörist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MessageWindow: Allow only JIDs as argument for get_control()
parent
fa434f54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
18 deletions
+9
-18
gajim/message_window.py
gajim/message_window.py
+9
-18
No files found.
gajim/message_window.py
View file @
3d45a6e0
...
...
@@ -732,25 +732,14 @@ def is_active(self):
def
get_origin
(
self
):
return
self
.
window
.
get_window
().
get_origin
()
def
get_control
(
self
,
key
,
acct
):
def
get_control
(
self
,
jid
,
acct
):
"""
Return the MessageControl for jid or n, where n is a notebook page index.
When key is an int index acct may be None
Return the MessageControl for jid
"""
if
isinstance
(
key
,
str
):
jid
=
key
try
:
return
self
.
_controls
[
acct
][
jid
]
except
Exception
:
return
None
else
:
page_num
=
key
notebook
=
self
.
notebook
if
page_num
is
None
:
page_num
=
notebook
.
get_current_page
()
nth_child
=
notebook
.
get_nth_page
(
page_num
)
return
self
.
_widget_to_control
(
nth_child
)
try
:
return
self
.
_controls
[
acct
][
jid
]
except
Exception
:
return
None
def
has_control
(
self
,
jid
,
acct
):
return
acct
in
self
.
_controls
and
jid
in
self
.
_controls
[
acct
]
...
...
@@ -801,7 +790,9 @@ def move_to_next_unread_tab(self, forward):
ind
=
ind
-
1
if
ind
<
0
:
ind
=
self
.
notebook
.
get_n_pages
()
-
1
ctrl
=
self
.
get_control
(
ind
,
None
)
nth_child
=
self
.
notebook
.
get_nth_page
(
ind
)
ctrl
=
self
.
_widget_to_control
(
nth_child
)
if
ctrl
.
get_nb_unread
()
>
0
:
found
=
True
break
# found
...
...
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