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
d2659b2c
Commit
d2659b2c
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
moving function to right place
parent
e418a3e0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/common/gajim.py
+9
-7
9 additions, 7 deletions
src/common/gajim.py
src/common/helpers.py
+0
-8
0 additions, 8 deletions
src/common/helpers.py
src/dialogs.py
+1
-1
1 addition, 1 deletion
src/dialogs.py
with
10 additions
and
16 deletions
src/common/gajim.py
+
9
−
7
View file @
d2659b2c
...
...
@@ -108,16 +108,18 @@ def get_first_contact_instance_from_jid(account, jid):
def
get_contact_instance_with_highest_priority
(
account
,
jid
):
contact_instances
=
contacts
[
account
][
jid
]
which_has_highest_prio
=
0
# which resource has highest priority?
which
=
0
for
c
in
contact_instances
[
1
:]:
which
+=
1
if
c
.
priority
>
which_has_highest_prio
:
which_has_highest_prio
=
which
return
contacts
[
account
][
jid
][
which_has_highest_prio
]
return
get_highest_prio_contact_from_contacts
(
contact_instances
)
def
get_contact_name_from_jid
(
account
,
jid
):
return
contacts
[
account
][
jid
][
0
].
name
def
get_highest_prio_contact_from_contacts
(
contacts
):
prim_contact
=
None
# primary contact
for
contact
in
contacts
:
if
prim_contact
==
None
or
int
(
contact
.
priority
)
>
\
int
(
prim_contact
.
priority
):
prim_contact
=
contact
return
prim_contact
def
get_jid_without_resource
(
jid
):
return
jid
.
split
(
'
/
'
)[
0
]
...
...
This diff is collapsed.
Click to expand it.
src/common/helpers.py
+
0
−
8
View file @
d2659b2c
...
...
@@ -25,14 +25,6 @@ from common import i18n
_
=
i18n
.
_
def
get_prim_contact_from_list
(
contacts
):
prim_contact
=
None
# primary contact
for
contact
in
contacts
:
if
prim_contact
==
None
or
int
(
contact
.
priority
)
>
\
int
(
prim_contact
.
priority
):
prim_contact
=
contact
return
prim_contact
def
convert_bytes
(
string
):
suffix
=
''
# IEC standard says KiB = 1024 bytes KB = 1000 bytes
...
...
This diff is collapsed.
Click to expand it.
src/dialogs.py
+
1
−
1
View file @
d2659b2c
...
...
@@ -814,7 +814,7 @@ class RosterTooltip(BaseTooltip, StatusTable):
self
.
hbox
.
set_homogeneous
(
False
)
self
.
create_table
()
# primary contact
prim_contact
=
helpers
.
ge
t_pri
m
_contact_from_
list
(
contacts
)
prim_contact
=
gajim
.
get_highes
t_pri
o
_contact_from_
contacts
(
contacts
)
# try to find the image for the contact status
state_file
=
prim_contact
.
show
.
replace
(
'
'
,
'
_
'
)
...
...
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