Commit 26c441dc authored by Philipp Hörist's avatar Philipp Hörist
Browse files

GajimRemote: Remove change_avatar command

parent 51e73a2e
......@@ -19,8 +19,6 @@ by D-Bus.
.Ss account_info Aq account
Gets detailed info on a account
.Ss change_avatar Ao picture Ac Bq account
Change the avatar
.Ss change_status Bo status Bc Bo message Bc Bq account
Changes the status of account or accounts
.Ss check_gajim_running
......@@ -224,15 +224,6 @@ def __init__(self):
'change_avatar': [
_('Change the avatar'),
('picture', _('Picture to use'), True),
('account', _('Account in which the avatar will be set; '
'if not specified, the avatar will be set for all accounts'),
'check_gajim_running': [
_('Check if Gajim is running'),
......@@ -23,8 +23,6 @@
# along with Gajim. If not, see <>.
import os
import base64
import mimetypes
import logging
from gi.repository import GLib
......@@ -132,10 +130,6 @@ class GajimRemote(Server):
<arg name='account' type='s' />
<arg direction='out' type='b' />
<method name='change_avatar'>
<arg name='picture' type='s' />
<arg name='account' type='s' />
<method name='change_status'>
<arg name='status' type='s' />
<arg name='message' type='s' />
......@@ -904,35 +898,6 @@ def send_xml(self, xml, account):
for acc in app.contacts.get_accounts():
def change_avatar(self, picture, account):
filesize = os.path.getsize(picture)
invalid_file = False
if os.path.isfile(picture):
stat = os.stat(picture)
if stat[6] == 0:
invalid_file = True
invalid_file = True
if not invalid_file and filesize < 16384:
sha = app.interface.save_avatar(picture, publish=True)
if sha is None:
app.config.set_per('accounts',, 'avatar_sha', sha)
data = app.interface.get_avatar_from_storage(sha, publish=True)
avatar = base64.b64encode(data).decode('utf-8')
avatar_mime_type = mimetypes.guess_type(picture)[0]
vcard = {}
vcard['PHOTO'] = {'BINVAL': avatar}
if avatar_mime_type:
vcard['PHOTO']['TYPE'] = avatar_mime_type
if account:
vcard, sha)
for acc in app.connections:
vcard, sha)
def join_room(self, room_jid, nick, password, account):
if not account:
# get the first connected account
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment