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
cb242e2b
Commit
cb242e2b
authored
19 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
remove contact from server list if it's useless (sub=ask=name=groups=None). Fixes #1821
parent
e51ed3f2
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
src/common/connection_handlers.py
+9
-6
9 additions, 6 deletions
src/common/connection_handlers.py
with
9 additions
and
6 deletions
src/common/connection_handlers.py
+
9
−
6
View file @
cb242e2b
...
...
@@ -1564,18 +1564,21 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco)
def
_on_roster_set
(
self
,
roster
):
raw_roster
=
roster
.
getRaw
()
roster
=
{}
our_jid
=
helpers
.
parse_jid
(
gajim
.
get_jid_from_account
(
self
.
name
))
for
jid
in
raw_roster
:
try
:
j
=
helpers
.
parse_jid
(
jid
)
except
:
print
>>
sys
.
stderr
,
_
(
'
JID %s is not RFC compliant. It will not be added to your roster. Use roster management tools such as http://jru.jabberstudio.org/ to remove it
'
)
%
jid
else
:
roster
[
j
]
=
raw_roster
[
jid
]
# Remove or jid
our_jid
=
helpers
.
parse_jid
(
gajim
.
get_jid_from_account
(
self
.
name
))
if
roster
.
has_key
(
our_jid
):
del
roster
[
our_jid
]
infos
=
raw_roster
[
jid
]
if
jid
!=
our_jid
and
(
not
infos
[
'
subscription
'
]
or
infos
[
'
subscription
'
]
==
\
'
none
'
)
and
(
not
infos
[
'
ask
'
]
or
infos
[
'
ask
'
]
==
'
none
'
)
and
not
infos
[
'
name
'
]
\
and
not
infos
[
'
groups
'
]:
# remove this useless item, it won't be shown in roster anyway
self
.
connection
.
getRoster
().
delItem
(
jid
)
elif
jid
!=
our_jid
:
# don't add our jid
roster
[
j
]
=
raw_roster
[
jid
]
self
.
dispatch
(
'
ROSTER
'
,
roster
)
...
...
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