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
eta
gajim
Commits
67bd94dd
Commit
67bd94dd
authored
16 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
fix property code in caps.py
parent
30f1a15e
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.py
+21
-21
21 additions, 21 deletions
src/common/caps.py
with
21 additions
and
21 deletions
src/common/caps.py
+
21
−
21
View file @
67bd94dd
...
...
@@ -98,26 +98,8 @@ class CapsCache(object):
# cached into db
ciself
.
hash_method
=
hash_method
ciself
.
hash
=
hash
@property
def
features
():
def
fget
(
self
):
return
self
.
getAttr
(
'
features
'
)
def
fset
(
self
,
value
):
list_
=
[]
for
feature
in
value
:
list_
.
append
(
self
.
__names
.
setdefault
(
feature
,
feature
))
self
.
setAttr
(
'
features
'
,
list_
)
@property
def
identities
():
def
fget
(
self
):
return
self
.
getAttr
(
'
identities
'
)
def
fset
(
self
,
value
):
list_
=
[]
for
identity
in
value
:
list_
.
append
(
self
.
__names
.
setdefault
(
identity
,
identity
))
self
.
setAttr
(
'
identities
'
,
list_
)
ciself
.
_features
=
[]
ciself
.
_identities
=
[]
# not cached into db:
# have we sent the query?
...
...
@@ -126,6 +108,24 @@ class CapsCache(object):
# 2 == got the answer
ciself
.
queried
=
0
def
_get_features
(
ciself
):
return
ciself
.
_features
def
_set_features
(
ciself
,
value
):
ciself
.
_features
=
[]
for
feature
in
value
:
ciself
.
_features
.
append
(
self
.
__names
.
setdefault
(
feature
,
feature
))
features
=
property
(
ciself
.
_get_features
,
ciself
.
_set_features
)
def
_get_identities
(
ciself
):
return
ciself
.
_identities
def
_set_identities
(
ciself
,
value
):
ciself
.
_identities
=
[]
for
identity
in
value
:
ciself
.
_identities
.
append
(
self
.
__names
.
setdefault
(
identity
,
identity
))
identities
=
property
(
ciself
.
_get_identities
,
ciself
.
_set_identities
)
def
update
(
ciself
,
identities
,
features
):
# NOTE: self refers to CapsCache object, not to CacheItem
ciself
.
identities
=
identities
...
...
@@ -213,7 +213,7 @@ class ConnectionCaps(object):
contact
.
caps_hash_method
=
hash_method
contact
.
caps_hash
=
hash
def
_capsDiscoCB
(
self
,
jid
,
node
,
identities
,
features
,
data
):
def
_capsDiscoCB
(
self
,
jid
,
node
,
identities
,
features
,
data
forms
):
contact
=
gajim
.
contacts
.
get_contact_from_full_jid
(
self
.
name
,
jid
)
if
not
contact
:
return
...
...
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