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
2fd4ea76
Commit
2fd4ea76
authored
16 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
keep caps info when we create a contact instance from groupchat_contact instance
parent
9ce8e28c
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/contacts.py
+12
-9
12 additions, 9 deletions
src/common/contacts.py
with
12 additions
and
9 deletions
src/common/contacts.py
+
12
−
9
View file @
2fd4ea76
...
...
@@ -26,9 +26,10 @@ import common.gajim
class
Contact
:
'''
Information concerning each contact
'''
def
__init__
(
self
,
jid
=
''
,
name
=
''
,
groups
=
[],
show
=
''
,
status
=
''
,
sub
=
''
,
ask
=
''
,
resource
=
''
,
priority
=
0
,
keyID
=
''
,
our_chatstate
=
None
,
chatstate
=
None
,
last_status_time
=
None
,
msg_id
=
None
,
composing_xep
=
None
,
mood
=
{},
tune
=
{},
activity
=
{}):
ask
=
''
,
resource
=
''
,
priority
=
0
,
keyID
=
''
,
caps_node
=
None
,
caps_hash_method
=
None
,
caps_hash
=
None
,
our_chatstate
=
None
,
chatstate
=
None
,
last_status_time
=
None
,
msg_id
=
None
,
composing_xep
=
None
,
mood
=
{},
tune
=
{},
activity
=
{}):
self
.
jid
=
jid
self
.
name
=
name
self
.
contact_name
=
''
# nick choosen by contact
...
...
@@ -43,9 +44,9 @@ class Contact:
# Capabilities; filled by caps.py/ConnectionCaps object
# every time it gets these from presence stanzas
self
.
caps_node
=
Non
e
self
.
caps_hash_method
=
None
self
.
caps_hash
=
None
self
.
caps_node
=
caps_nod
e
self
.
caps_hash_method
=
caps_hash_method
self
.
caps_hash
=
caps_hash
# please read xep-85 http://www.xmpp.org/extensions/xep-0085.html
# we keep track of xep85 support with the peer by three extra states:
...
...
@@ -533,9 +534,11 @@ class Contacts:
def
contact_from_gc_contact
(
self
,
gc_contact
):
'''
Create a Contact instance from a GC_Contact instance
'''
jid
=
gc_contact
.
get_full_jid
()
return
Contact
(
jid
=
jid
,
resource
=
''
,
name
=
gc_contact
.
name
,
groups
=
[],
show
=
gc_contact
.
show
,
status
=
gc_contact
.
status
,
sub
=
'
none
'
)
return
Contact
(
jid
=
jid
,
resource
=
''
,
name
=
gc_contact
.
name
,
groups
=
[],
show
=
gc_contact
.
show
,
status
=
gc_contact
.
status
,
sub
=
'
none
'
,
caps_node
=
gc_contact
.
caps_node
,
caps_hash_method
=
gc_contact
.
caps_hash_method
,
caps_hash
=
gc_contact
.
caps_hash
)
def
create_gc_contact
(
self
,
room_jid
=
''
,
name
=
''
,
show
=
''
,
status
=
''
,
role
=
''
,
affiliation
=
''
,
jid
=
''
,
resource
=
''
):
...
...
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