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
57c3221d
Commit
57c3221d
authored
17 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
[misc] remove duplicate function. fixes #3524
parent
c15b616d
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/profile_window.py
+2
-26
2 additions, 26 deletions
src/profile_window.py
with
2 additions
and
26 deletions
src/profile_window.py
+
2
−
26
View file @
57c3221d
...
...
@@ -28,35 +28,11 @@ import os
import
gtkgui_helpers
import
dialogs
import
vcard
from
common
import
gajim
from
common.i18n
import
Q_
def
get_avatar_pixbuf_encoded_mime
(
photo
):
'''
return the pixbuf of the image
photo is a dictionary containing PHOTO information
'''
if
not
isinstance
(
photo
,
dict
):
return
None
,
None
,
None
img_decoded
=
None
avatar_encoded
=
None
avatar_mime_type
=
None
if
photo
.
has_key
(
'
BINVAL
'
):
img_encoded
=
photo
[
'
BINVAL
'
]
avatar_encoded
=
img_encoded
try
:
img_decoded
=
base64
.
decodestring
(
img_encoded
)
except
:
pass
if
img_decoded
:
if
photo
.
has_key
(
'
TYPE
'
):
avatar_mime_type
=
photo
[
'
TYPE
'
]
pixbuf
=
gtkgui_helpers
.
get_pixbuf_from_data
(
img_decoded
)
else
:
pixbuf
,
avatar_mime_type
=
gtkgui_helpers
.
get_pixbuf_from_data
(
img_decoded
,
want_type
=
True
)
else
:
pixbuf
=
None
return
pixbuf
,
avatar_encoded
,
avatar_mime_type
class
ProfileWindow
:
'''
Class for our information window
'''
...
...
@@ -228,7 +204,7 @@ class ProfileWindow:
for
i
in
vcard
.
keys
():
if
i
==
'
PHOTO
'
:
pixbuf
,
self
.
avatar_encoded
,
self
.
avatar_mime_type
=
\
get_avatar_pixbuf_encoded_mime
(
vcard
[
i
])
vcard
.
get_avatar_pixbuf_encoded_mime
(
vcard
[
i
])
if
not
pixbuf
:
image
.
set_from_pixbuf
(
None
)
button
.
hide
()
...
...
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