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
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Peter Shkenev
gajim
Commits
69a6aaff
Commit
69a6aaff
authored
19 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
vcard is more complete (avatar is commig soon)
parent
147e14ee
No related branches found
No related tags found
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/common/connection.py
+14
-6
14 additions, 6 deletions
src/common/connection.py
src/gtkgui.glade
+639
-50
639 additions, 50 deletions
src/gtkgui.glade
src/vcard.py
+27
-11
27 additions, 11 deletions
src/vcard.py
with
680 additions
and
67 deletions
src/common/connection.py
+
14
−
6
View file @
69a6aaff
...
...
@@ -881,6 +881,7 @@ def request_vcard(self, jid = None):
iq
.
setTag
(
common
.
xmpp
.
NS_VCARD
+
'
vCard
'
)
self
.
connection
.
send
(
iq
)
return
iq
#('VCARD', {entry1: data, entry2: {entry21: data, ...}, ...})
def
send_vcard
(
self
,
vcard
):
...
...
@@ -889,13 +890,20 @@ def send_vcard(self, vcard):
iq
=
common
.
xmpp
.
Iq
(
typ
=
'
set
'
)
iq2
=
iq
.
setTag
(
common
.
xmpp
.
NS_VCARD
+
'
vCard
'
)
for
i
in
vcard
.
keys
():
if
i
!=
'
jid
'
:
if
type
(
vcard
[
i
])
==
type
({}):
iq3
=
iq2
.
addChild
(
i
)
for
j
in
vcard
[
i
].
keys
():
if
i
==
'
jid
'
:
continue
if
type
(
vcard
[
i
])
==
type
({}):
for
j
in
vcard
[
i
].
keys
():
if
type
(
vcard
[
i
][
j
])
==
type
({}):
iq3
=
iq2
.
addChild
(
i
)
iq3
.
addChild
(
j
)
for
k
in
vcard
[
i
][
j
]:
iq3
.
addChild
(
k
).
setData
(
vcard
[
i
][
j
][
k
])
else
:
iq3
=
iq2
.
addChild
(
i
)
iq3
.
addChild
(
j
).
setData
(
vcard
[
i
][
j
])
else
:
iq2
.
addChild
(
i
).
setData
(
vcard
[
i
])
else
:
iq2
.
addChild
(
i
).
setData
(
vcard
[
i
])
self
.
connection
.
send
(
iq
)
def
send_agent_status
(
self
,
agent
,
ptype
):
...
...
This diff is collapsed.
Click to expand it.
src/gtkgui.glade
+
639
−
50
View file @
69a6aaff
This diff is collapsed.
Click to expand it.
src/vcard.py
+
27
−
11
View file @
69a6aaff
...
...
@@ -76,9 +76,13 @@ def set_value(self, entry_name, value):
def
set_values
(
self
,
vcard
):
for
i
in
vcard
.
keys
():
if
type
(
vcard
[
i
])
==
type
({}):
add_on
=
''
if
i
==
'
ADR
'
or
i
==
'
TEL
'
or
i
==
'
EMAIL
'
:
add_on
=
'
_HOME
'
if
'
WORK
'
in
vcard
[
i
]:
add_on
=
'
_WORK
'
for
j
in
vcard
[
i
].
keys
():
self
.
set_value
(
i
+
'
_
'
+
j
+
'
_entry
'
,
vcard
[
i
][
j
])
self
.
set_value
(
i
+
add_on
+
'
_
'
+
j
+
'
_entry
'
,
vcard
[
i
][
j
])
else
:
if
i
==
'
DESC
'
:
self
.
xml
.
get_widget
(
'
DESC_textview
'
).
get_buffer
().
set_text
(
...
...
@@ -163,9 +167,13 @@ def add_to_vcard(self, vcard, entry, txt):
def
make_vcard
(
self
):
'''
make the vCard dictionary
'''
entries
=
[
'
FN
'
,
'
NICKNAME
'
,
'
BDAY
'
,
'
EMAIL_USERID
'
,
'
URL
'
,
'
TEL_NUMBER
'
,
'
ADR_STREET
'
,
'
ADR_EXTADR
'
,
'
ADR_LOCALITY
'
,
'
ADR_REGION
'
,
'
ADR_PCODE
'
,
'
ADR_CTRY
'
,
'
ORG_ORGNAME
'
,
'
ORG_ORGUNIT
'
,
'
TITLE
'
,
'
ROLE
'
]
entries
=
[
'
FN
'
,
'
NICKNAME
'
,
'
BDAY
'
,
'
EMAIL_HOME_USERID
'
,
'
URL
'
,
'
TEL_HOME_NUMBER
'
,
'
N_FAMILY
'
,
'
N_GIVEN
'
,
'
N_MIDDLE
'
,
'
N_PREFIX
'
,
'
N_SUFFIX
'
,
'
ADR_HOME_STREET
'
,
'
ADR_HOME_EXTADR
'
,
'
ADR_HOME_LOCALITY
'
,
'
ADR_HOME_REGION
'
,
'
ADR_HOME_PCODE
'
,
'
ADR_HOME_CTRY
'
,
'
ORG_ORGNAME
'
,
'
ORG_ORGUNIT
'
,
'
TITLE
'
,
'
ROLE
'
,
'
ADR_WORK_STREET
'
,
'
ADR_WORK_EXTADR
'
,
'
ADR_WORK_LOCALITY
'
,
'
ADR_WORK_REGION
'
,
'
ADR_WORK_PCODE
'
,
'
ADR_WORK_CTRY
'
]
vcard
=
{}
for
e
in
entries
:
txt
=
self
.
xml
.
get_widget
(
e
+
'
_entry
'
).
get_text
()
...
...
@@ -193,9 +201,13 @@ def on_publish_button_clicked(self, widget):
gajim
.
connections
[
self
.
account
].
send_vcard
(
vcard
)
def
on_retrieve_button_clicked
(
self
,
widget
):
entries
=
[
'
FN
'
,
'
NICKNAME
'
,
'
BDAY
'
,
'
EMAIL_USERID
'
,
'
URL
'
,
'
TEL_NUMBER
'
,
'
ADR_STREET
'
,
'
ADR_EXTADR
'
,
'
ADR_LOCALITY
'
,
'
ADR_REGION
'
,
'
ADR_PCODE
'
,
'
ADR_CTRY
'
,
'
ORG_ORGNAME
'
,
'
ORG_ORGUNIT
'
,
'
TITLE
'
,
'
ROLE
'
]
entries
=
[
'
FN
'
,
'
NICKNAME
'
,
'
BDAY
'
,
'
EMAIL_HOME_USERID
'
,
'
URL
'
,
'
TEL_HOME_NUMBER
'
,
'
N_FAMILY
'
,
'
N_GIVEN
'
,
'
N_MIDDLE
'
,
'
N_PREFIX
'
,
'
N_SUFFIX
'
,
'
ADR_HOME_STREET
'
,
'
ADR_HOME_EXTADR
'
,
'
ADR_HOME_LOCALITY
'
,
'
ADR_HOME_REGION
'
,
'
ADR_HOME_PCODE
'
,
'
ADR_HOME_CTRY
'
,
'
ORG_ORGNAME
'
,
'
ORG_ORGUNIT
'
,
'
TITLE
'
,
'
ROLE
'
,
'
ADR_WORK_STREET
'
,
'
ADR_WORK_EXTADR
'
,
'
ADR_WORK_LOCALITY
'
,
'
ADR_WORK_REGION
'
,
'
ADR_WORK_PCODE
'
,
'
ADR_WORK_CTRY
'
]
if
gajim
.
connections
[
self
.
account
].
connected
>
1
:
# clear all entries
for
e
in
entries
:
...
...
@@ -228,9 +240,13 @@ def change_to_vcard(self):
information_hbuttonbox
.
reorder_child
(
button
,
2
)
#make all entries editable
entries
=
[
'
FN
'
,
'
NICKNAME
'
,
'
BDAY
'
,
'
EMAIL_USERID
'
,
'
URL
'
,
'
TEL_NUMBER
'
,
'
ADR_STREET
'
,
'
ADR_EXTADR
'
,
'
ADR_LOCALITY
'
,
'
ADR_REGION
'
,
'
ADR_PCODE
'
,
'
ADR_CTRY
'
,
'
ORG_ORGNAME
'
,
'
ORG_ORGUNIT
'
,
'
TITLE
'
,
'
ROLE
'
]
entries
=
[
'
FN
'
,
'
NICKNAME
'
,
'
BDAY
'
,
'
EMAIL_HOME_USERID
'
,
'
URL
'
,
'
TEL_HOME_NUMBER
'
,
'
N_FAMILY
'
,
'
N_GIVEN
'
,
'
N_MIDDLE
'
,
'
N_PREFIX
'
,
'
N_SUFFIX
'
,
'
ADR_HOME_STREET
'
,
'
ADR_HOME_EXTADR
'
,
'
ADR_HOME_LOCALITY
'
,
'
ADR_HOME_REGION
'
,
'
ADR_HOME_PCODE
'
,
'
ADR_HOME_CTRY
'
,
'
ORG_ORGNAME
'
,
'
ORG_ORGUNIT
'
,
'
TITLE
'
,
'
ROLE
'
,
'
ADR_WORK_STREET
'
,
'
ADR_WORK_EXTADR
'
,
'
ADR_WORK_LOCALITY
'
,
'
ADR_WORK_REGION
'
,
'
ADR_WORK_PCODE
'
,
'
ADR_WORK_CTRY
'
]
for
e
in
entries
:
self
.
xml
.
get_widget
(
e
+
'
_entry
'
).
set_property
(
'
editable
'
,
True
)
...
...
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