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
Erik Huelsmann
gajim
Commits
85a35a21
Commit
85a35a21
authored
15 years ago
by
steve-e
Browse files
Options
Downloads
Patches
Plain Diff
Correctly fake NullClientCaps: Assume we support everything instead of the blacklisted features.
parent
da0749b5
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/caps_cache.py
+4
-3
4 additions, 3 deletions
src/common/caps_cache.py
with
4 additions
and
3 deletions
src/common/caps_cache.py
+
4
−
3
View file @
85a35a21
...
...
@@ -47,6 +47,7 @@ FEATURE_BLACKLIST = [NS_CHATSTATES, NS_XHTML_IM, NS_RECEIPTS, NS_ESESSION,
NEW
=
0
QUERIED
=
1
CACHED
=
2
# got the answer
FAKED
=
3
# allow NullClientCaps to behave as it has a cached item
################################################################################
### Public API of this module
...
...
@@ -67,7 +68,7 @@ def client_supports(client_caps, requested_feature):
supported_features
=
cache_item
.
features
if
requested_feature
in
supported_features
:
return
True
elif
supported_features
==
[]
and
cache_item
.
status
in
(
NEW
,
QUERIED
):
elif
not
supported_features
and
cache_item
.
status
in
(
NEW
,
QUERIED
,
FAKED
):
# assume feature is supported, if we don't know yet, what the client
# is capable of
return
requested_feature
not
in
FEATURE_BLACKLIST
...
...
@@ -262,7 +263,7 @@ class NullClientCaps(AbstractClientCaps):
# lookup something which does not exist to get a new CacheItem created
cache_item
=
caps_cache
[(
'
dummy
'
,
''
)]
# Mark the item as cached so that protocol/caps.py does not update it
cache_item
.
status
=
CACH
ED
cache_item
.
status
=
FAK
ED
return
cache_item
def
_discover
(
self
,
connection
,
jid
):
...
...
@@ -354,7 +355,7 @@ class CapsCache(object):
Returns True if identities and features for this cache item
are known.
"""
return
self
.
status
==
CACHED
return
self
.
status
in
(
CACHED
,
FAKED
)
self
.
__CacheItem
=
CacheItem
self
.
logger
=
logger
...
...
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