2005-09-07 23:12:30 +02:00
|
|
|
## remote_control.py
|
2005-07-17 23:41:54 +02:00
|
|
|
##
|
2005-12-09 18:15:30 +01:00
|
|
|
## Contributors for this file:
|
2005-07-17 23:41:54 +02:00
|
|
|
## - Yann Le Boulanger <asterix@lagaule.org>
|
|
|
|
## - Nikos Kouremenos <kourem@gmail.com>
|
2005-09-07 23:12:30 +02:00
|
|
|
## - Dimitur Kirov <dkirov@gmail.com>
|
2005-12-10 01:59:02 +01:00
|
|
|
## - Andrew Sayman <lorien420@myrealbox.com>
|
2005-07-17 23:41:54 +02:00
|
|
|
##
|
2005-12-10 00:30:28 +01:00
|
|
|
## Copyright (C) 2003-2004 Yann Le Boulanger <asterix@lagaule.org>
|
|
|
|
## Vincent Hanquez <tab@snarc.org>
|
|
|
|
## Copyright (C) 2005 Yann Le Boulanger <asterix@lagaule.org>
|
|
|
|
## Vincent Hanquez <tab@snarc.org>
|
|
|
|
## Nikos Kouremenos <nkour@jabber.org>
|
|
|
|
## Dimitur Kirov <dkirov@gmail.com>
|
|
|
|
## Travis Shirk <travis@pobox.com>
|
|
|
|
## Norman Rasmussen <norman@rasmussen.co.za>
|
2005-07-17 23:41:54 +02:00
|
|
|
##
|
|
|
|
## This program is free software; you can redistribute it and/or modify
|
|
|
|
## it under the terms of the GNU General Public License as published
|
|
|
|
## by the Free Software Foundation; version 2 only.
|
|
|
|
##
|
|
|
|
## This program is distributed in the hope that it will be useful,
|
|
|
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
## GNU General Public License for more details.
|
|
|
|
##
|
|
|
|
|
|
|
|
import gobject
|
2005-07-20 02:29:31 +02:00
|
|
|
import gtk
|
2005-08-15 20:28:19 +02:00
|
|
|
import os
|
2005-09-15 22:40:55 +02:00
|
|
|
import sys
|
2005-07-17 23:41:54 +02:00
|
|
|
|
2005-12-05 00:15:43 +01:00
|
|
|
import systray
|
|
|
|
|
2005-12-01 18:49:45 +01:00
|
|
|
from common import exceptions
|
2005-07-17 23:41:54 +02:00
|
|
|
from common import gajim
|
2005-12-14 18:55:03 +01:00
|
|
|
from common import helpers
|
2005-07-17 23:41:54 +02:00
|
|
|
from time import time
|
2005-07-19 22:12:02 +02:00
|
|
|
from common import i18n
|
2005-09-10 00:22:05 +02:00
|
|
|
from dialogs import AddNewContactWindow
|
2005-07-19 22:12:02 +02:00
|
|
|
_ = i18n._
|
|
|
|
|
2005-12-10 01:56:38 +01:00
|
|
|
import dbus_support
|
|
|
|
if dbus_support.supported:
|
2005-07-17 23:41:54 +02:00
|
|
|
import dbus
|
2005-12-10 01:56:38 +01:00
|
|
|
if dbus_support.version >= (0, 41, 0):
|
|
|
|
import dbus.service
|
|
|
|
import dbus.glib # cause dbus 0.35+ doesn't return signal replies without it
|
|
|
|
DbusPrototype = dbus.service.Object
|
|
|
|
elif dbus_support.version >= (0, 20, 0):
|
|
|
|
DbusPrototype = dbus.Object
|
|
|
|
else: #dbus is not defined
|
|
|
|
DbusPrototype = str
|
2005-07-17 23:41:54 +02:00
|
|
|
|
|
|
|
INTERFACE = 'org.gajim.dbus.RemoteInterface'
|
|
|
|
OBJ_PATH = '/org/gajim/dbus/RemoteObject'
|
|
|
|
SERVICE = 'org.gajim.dbus'
|
|
|
|
|
2005-11-30 16:26:08 +01:00
|
|
|
STATUS_LIST = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd',
|
|
|
|
'invisible']
|
|
|
|
|
2005-07-17 23:41:54 +02:00
|
|
|
class Remote:
|
2005-10-20 13:17:17 +02:00
|
|
|
def __init__(self):
|
2005-07-17 23:41:54 +02:00
|
|
|
self.signal_object = None
|
2005-12-10 01:56:38 +01:00
|
|
|
session_bus = dbus_support.session_bus.SessionBus()
|
2005-07-17 23:41:54 +02:00
|
|
|
|
2005-12-10 01:56:38 +01:00
|
|
|
if dbus_support.version[1] >= 41:
|
2005-07-17 23:41:54 +02:00
|
|
|
service = dbus.service.BusName(SERVICE, bus=session_bus)
|
2005-10-20 13:17:17 +02:00
|
|
|
self.signal_object = SignalObject(service)
|
2005-12-10 01:56:38 +01:00
|
|
|
elif dbus_support.version[1] <= 40 and dbus_support.version[1] >= 20:
|
2005-07-17 23:41:54 +02:00
|
|
|
service=dbus.Service(SERVICE, session_bus)
|
2005-10-20 13:17:17 +02:00
|
|
|
self.signal_object = SignalObject(service)
|
2005-07-19 17:07:00 +02:00
|
|
|
|
2005-07-17 23:41:54 +02:00
|
|
|
def raise_signal(self, signal, arg):
|
|
|
|
if self.signal_object:
|
|
|
|
self.signal_object.raise_signal(signal, repr(arg))
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
|
2005-07-17 23:41:54 +02:00
|
|
|
|
|
|
|
class SignalObject(DbusPrototype):
|
2005-07-19 17:07:00 +02:00
|
|
|
''' Local object definition for /org/gajim/dbus/RemoteObject. This doc must
|
|
|
|
not be visible, because the clients can access only the remote object. '''
|
2005-07-17 23:41:54 +02:00
|
|
|
|
2005-10-20 13:17:17 +02:00
|
|
|
def __init__(self, service):
|
2005-07-17 23:41:54 +02:00
|
|
|
self.first_show = True
|
|
|
|
self.vcard_account = None
|
2005-07-19 17:07:00 +02:00
|
|
|
|
2005-07-17 23:41:54 +02:00
|
|
|
# register our dbus API
|
2005-12-10 01:56:38 +01:00
|
|
|
if dbus_support.version[1] >= 41:
|
2005-07-17 23:41:54 +02:00
|
|
|
DbusPrototype.__init__(self, service, OBJ_PATH)
|
2005-12-10 01:56:38 +01:00
|
|
|
elif dbus_support.version[1] >= 30:
|
2005-07-17 23:41:54 +02:00
|
|
|
DbusPrototype.__init__(self, OBJ_PATH, service)
|
|
|
|
else:
|
|
|
|
DbusPrototype.__init__(self, OBJ_PATH, service,
|
2005-07-19 16:25:41 +02:00
|
|
|
[ self.toggle_roster_appearance,
|
2005-07-18 00:38:38 +02:00
|
|
|
self.show_next_unread,
|
2005-07-17 23:41:54 +02:00
|
|
|
self.list_contacts,
|
|
|
|
self.list_accounts,
|
|
|
|
self.change_status,
|
2005-07-20 15:27:27 +02:00
|
|
|
self.open_chat,
|
2005-07-17 23:41:54 +02:00
|
|
|
self.send_message,
|
2005-08-24 01:41:23 +02:00
|
|
|
self.contact_info,
|
2005-09-09 17:29:32 +02:00
|
|
|
self.send_file,
|
|
|
|
self.prefs_list,
|
|
|
|
self.prefs_store,
|
|
|
|
self.prefs_del,
|
|
|
|
self.prefs_put,
|
2005-09-10 00:22:05 +02:00
|
|
|
self.add_contact,
|
2005-11-30 16:26:08 +01:00
|
|
|
self.remove_contact,
|
|
|
|
self.get_status,
|
2005-12-30 22:37:36 +01:00
|
|
|
self.get_status_message,
|
2005-07-17 23:41:54 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
def raise_signal(self, signal, arg):
|
|
|
|
''' raise a signal, with a single string message '''
|
2005-12-10 01:56:38 +01:00
|
|
|
if dbus_support.version[1] >= 30:
|
2005-07-17 23:41:54 +02:00
|
|
|
from dbus import dbus_bindings
|
|
|
|
message = dbus_bindings.Signal(OBJ_PATH, INTERFACE, signal)
|
2005-07-19 22:12:02 +02:00
|
|
|
i = message.get_iter(True)
|
|
|
|
i.append(arg)
|
2005-07-17 23:41:54 +02:00
|
|
|
self._connection.send(message)
|
|
|
|
else:
|
|
|
|
self.emit_signal(INTERFACE, signal, arg)
|
|
|
|
|
|
|
|
# signals
|
|
|
|
def VcardInfo(self, *vcard):
|
|
|
|
pass
|
|
|
|
|
2005-11-30 16:26:08 +01:00
|
|
|
def get_status(self, *args):
|
|
|
|
'''get_status(account = None)
|
|
|
|
returns status (show to be exact) which is the global one
|
|
|
|
unless account is given'''
|
2005-11-30 17:17:06 +01:00
|
|
|
account = self._get_real_arguments(args, 1)[0]
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
accounts = gajim.contacts.get_accounts()
|
2005-12-14 18:55:03 +01:00
|
|
|
if not account:
|
|
|
|
# If user did not ask for account, returns the global status
|
|
|
|
return helpers.get_global_show()
|
|
|
|
# return show for the given account
|
|
|
|
index = gajim.connections[account].connected
|
|
|
|
return STATUS_LIST[index]
|
2005-12-30 22:37:36 +01:00
|
|
|
|
|
|
|
def get_status_message(self, *args):
|
|
|
|
'''get_status(account = None)
|
|
|
|
returns status which is the global one
|
|
|
|
unless account is given'''
|
|
|
|
account = self._get_real_arguments(args, 1)[0]
|
2006-02-02 19:42:29 +01:00
|
|
|
accounts = gajim.contacts.get_accounts()
|
2005-12-30 22:37:36 +01:00
|
|
|
if not account:
|
|
|
|
# If user did not ask for account, returns the global status
|
|
|
|
return str(helpers.get_global_status())
|
|
|
|
# return show for the given account
|
|
|
|
status = gajim.connections[account].status
|
|
|
|
return str(status)
|
|
|
|
|
2005-11-30 16:26:08 +01:00
|
|
|
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
def get_account_and_contact(self, account, jid):
|
|
|
|
''' get the account (if not given) and contact instance from jid'''
|
|
|
|
connected_account = None
|
|
|
|
contact = None
|
|
|
|
accounts = gajim.contacts.get_accounts()
|
2005-08-24 01:41:23 +02:00
|
|
|
# if there is only one account in roster, take it as default
|
2005-11-30 16:26:08 +01:00
|
|
|
# if user did not ask for account
|
2005-08-24 01:41:23 +02:00
|
|
|
if not account and len(accounts) == 1:
|
|
|
|
account = accounts[0]
|
|
|
|
if account:
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
if gajim.connections[account].connected > 1: # account is connected
|
|
|
|
connected_account = account
|
|
|
|
contact = gajim.contacts.get_contact_with_highest_priority(account,
|
|
|
|
jid)
|
2005-08-24 01:41:23 +02:00
|
|
|
else:
|
|
|
|
for account in accounts:
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
contact = gajim.contacts.get_contact_with_highest_priority(account,
|
|
|
|
jid)
|
|
|
|
if contact and gajim.connections[account].connected > 1:
|
|
|
|
# account is connected
|
|
|
|
connected_account = account
|
2005-08-24 01:41:23 +02:00
|
|
|
break
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
if not contact:
|
2005-08-24 01:41:23 +02:00
|
|
|
contact = jid
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
|
|
|
|
return connected_account, contact
|
|
|
|
|
|
|
|
def send_file(self, *args):
|
|
|
|
'''send_file(file_path, jid, account=None)
|
|
|
|
send file, located at 'file_path' to 'jid', using account
|
|
|
|
(optional) 'account' '''
|
|
|
|
file_path, jid, account = self._get_real_arguments(args, 3)
|
|
|
|
|
|
|
|
connected_account, contact = self.get_account_and_contact(account, jid)
|
|
|
|
|
2005-08-24 01:41:23 +02:00
|
|
|
if connected_account:
|
|
|
|
if os.path.isfile(file_path): # is it file?
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
gajim.interface.instances['file_transfers'].send_file(
|
|
|
|
connected_account, contact, file_path)
|
2005-08-24 01:41:23 +02:00
|
|
|
return True
|
|
|
|
return False
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
|
2005-07-17 23:41:54 +02:00
|
|
|
def send_message(self, *args):
|
|
|
|
''' send_message(jid, message, keyID=None, account=None)
|
|
|
|
send 'message' to 'jid', using account (optional) 'account'.
|
|
|
|
if keyID is specified, encrypt the message with the pgp key '''
|
|
|
|
jid, message, keyID, account = self._get_real_arguments(args, 4)
|
|
|
|
if not jid or not message:
|
|
|
|
return None # or raise error
|
|
|
|
if not keyID:
|
|
|
|
keyID = ''
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
|
|
|
|
connected_account, contact = self.get_account_and_contact(account, jid)
|
|
|
|
|
2005-07-20 16:12:49 +02:00
|
|
|
if connected_account:
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
connection = gajim.connections[connected_account]
|
|
|
|
res = connection.send_message(jid, message, keyID)
|
2005-07-20 16:12:49 +02:00
|
|
|
return True
|
2005-07-17 23:41:54 +02:00
|
|
|
return False
|
|
|
|
|
2005-07-20 15:27:27 +02:00
|
|
|
def open_chat(self, *args):
|
|
|
|
''' start_chat(jid, account=None) -> shows the tabbed window for new
|
2005-09-07 23:12:30 +02:00
|
|
|
message to 'jid', using account(optional) 'account' '''
|
2005-07-17 23:41:54 +02:00
|
|
|
jid, account = self._get_real_arguments(args, 2)
|
|
|
|
if not jid:
|
2005-09-07 23:12:30 +02:00
|
|
|
# FIXME: raise exception for missing argument (dbus0.35+)
|
2005-07-17 23:41:54 +02:00
|
|
|
return None
|
2005-09-17 13:26:15 +02:00
|
|
|
if jid.startswith('xmpp:'):
|
2005-09-08 12:24:33 +02:00
|
|
|
jid = jid[5:] # len('xmpp:') = 5
|
2005-09-07 23:12:30 +02:00
|
|
|
|
2005-07-17 23:41:54 +02:00
|
|
|
if account:
|
|
|
|
accounts = [account]
|
|
|
|
else:
|
2005-07-18 23:08:31 +02:00
|
|
|
accounts = gajim.connections.keys()
|
2005-07-20 17:45:56 +02:00
|
|
|
if len(accounts) == 1:
|
|
|
|
account = accounts[0]
|
2005-07-20 16:12:49 +02:00
|
|
|
connected_account = None
|
2005-09-13 16:28:22 +02:00
|
|
|
first_connected_acct = None
|
2005-07-20 17:45:56 +02:00
|
|
|
for acct in accounts:
|
|
|
|
if gajim.connections[acct].connected > 1: # account is online
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
contact = gajim.contacts.get_first_contact_from_jid(acct, jid)
|
2006-01-25 03:43:55 +01:00
|
|
|
if gajim.interface.msg_win_mgr.has_window(jid, acct):
|
2005-07-20 17:45:56 +02:00
|
|
|
connected_account = acct
|
|
|
|
break
|
|
|
|
# jid is in roster
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
elif contact:
|
2005-07-20 17:45:56 +02:00
|
|
|
connected_account = acct
|
2005-07-20 16:12:49 +02:00
|
|
|
break
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
# we send the message to jid not in roster, because account is
|
|
|
|
# specified, or there is only one account
|
2005-07-20 17:45:56 +02:00
|
|
|
elif account:
|
|
|
|
connected_account = acct
|
2005-09-13 16:28:22 +02:00
|
|
|
elif first_connected_acct is None:
|
|
|
|
first_connected_acct = acct
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
|
2005-09-13 16:15:13 +02:00
|
|
|
# if jid is not a conntact, open-chat with first connected account
|
2005-09-13 16:28:22 +02:00
|
|
|
if connected_account is None and first_connected_acct:
|
|
|
|
connected_account = first_connected_acct
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
|
2005-07-20 16:12:49 +02:00
|
|
|
if connected_account:
|
2005-10-20 13:17:17 +02:00
|
|
|
gajim.interface.roster.new_chat_from_jid(connected_account, jid)
|
2005-07-20 16:12:49 +02:00
|
|
|
# preserve the 'steal focus preservation'
|
2006-01-25 03:43:55 +01:00
|
|
|
win = gajim.interface.msg_win_mgr.get_window(jid, connected_account).window
|
2005-07-20 16:12:49 +02:00
|
|
|
if win.get_property('visible'):
|
|
|
|
win.window.focus()
|
2005-07-20 17:45:56 +02:00
|
|
|
return True
|
|
|
|
return False
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
|
2005-07-17 23:41:54 +02:00
|
|
|
def change_status(self, *args, **keywords):
|
|
|
|
''' change_status(status, message, account). account is optional -
|
|
|
|
if not specified status is changed for all accounts. '''
|
|
|
|
status, message, account = self._get_real_arguments(args, 3)
|
|
|
|
if status not in ('offline', 'online', 'chat',
|
|
|
|
'away', 'xa', 'dnd', 'invisible'):
|
2005-07-20 15:27:27 +02:00
|
|
|
# FIXME: raise exception for bad status (dbus0.35)
|
2005-07-17 23:41:54 +02:00
|
|
|
return None
|
|
|
|
if account:
|
2005-10-20 13:17:17 +02:00
|
|
|
gobject.idle_add(gajim.interface.roster.send_status, account,
|
2005-07-17 23:41:54 +02:00
|
|
|
status, message)
|
|
|
|
else:
|
|
|
|
# account not specified, so change the status of all accounts
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
for acc in gajim.contacts.get_accounts():
|
2005-10-20 13:17:17 +02:00
|
|
|
gobject.idle_add(gajim.interface.roster.send_status, acc,
|
2005-07-17 23:41:54 +02:00
|
|
|
status, message)
|
|
|
|
return None
|
|
|
|
|
2005-07-18 00:30:46 +02:00
|
|
|
def show_next_unread(self, *args):
|
2005-07-18 00:38:38 +02:00
|
|
|
''' Show the window(s) with next waiting messages in tabbed/group chats. '''
|
2005-07-17 23:41:54 +02:00
|
|
|
#FIXME: when systray is disabled this method does nothing.
|
2005-10-20 13:17:17 +02:00
|
|
|
if len(gajim.interface.systray.jids) != 0:
|
2005-12-05 00:15:43 +01:00
|
|
|
gajim.interface.systray.handle_first_event()
|
2005-07-17 23:41:54 +02:00
|
|
|
|
|
|
|
def contact_info(self, *args):
|
2005-07-18 00:30:46 +02:00
|
|
|
''' get vcard info for a contact. This method returns nothing.
|
|
|
|
You have to register the 'VcardInfo' signal to get the real vcard. '''
|
2005-07-20 03:29:40 +02:00
|
|
|
[jid] = self._get_real_arguments(args, 1)
|
2005-09-06 15:17:10 +02:00
|
|
|
if not isinstance(jid, unicode):
|
|
|
|
jid = unicode(jid)
|
2005-07-17 23:41:54 +02:00
|
|
|
if not jid:
|
|
|
|
# FIXME: raise exception for missing argument (0.3+)
|
|
|
|
return None
|
2005-07-18 00:30:46 +02:00
|
|
|
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
accounts = gajim.contacts.get_accounts()
|
|
|
|
|
2005-07-17 23:41:54 +02:00
|
|
|
for account in accounts:
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
contact = gajim.contacts.get_first_contact_from_jid(account, jid)
|
|
|
|
if contact:
|
2005-07-17 23:41:54 +02:00
|
|
|
self.vcard_account = account
|
2005-07-19 22:12:02 +02:00
|
|
|
gajim.connections[account].request_vcard(jid)
|
2005-07-17 23:41:54 +02:00
|
|
|
break
|
|
|
|
return None
|
|
|
|
|
|
|
|
def list_accounts(self, *args):
|
|
|
|
''' list register accounts '''
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
result = gajim.contacts.get_accounts()
|
|
|
|
if result and len(result) > 0:
|
|
|
|
result_array = []
|
|
|
|
for account in result:
|
|
|
|
result_array.append(account.encode('utf-8'))
|
|
|
|
return result_array
|
2005-07-17 23:41:54 +02:00
|
|
|
return None
|
|
|
|
|
|
|
|
def list_contacts(self, *args):
|
|
|
|
''' list all contacts in the roster. If the first argument is specified,
|
|
|
|
then return the contacts for the specified account '''
|
|
|
|
[for_account] = self._get_real_arguments(args, 1)
|
|
|
|
result = []
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
accounts = gajim.contacts.get_accounts()
|
|
|
|
if len(accounts) == 0:
|
2005-07-17 23:41:54 +02:00
|
|
|
return None
|
|
|
|
if for_account:
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
accounts_to_search = [for_account]
|
2005-07-17 23:41:54 +02:00
|
|
|
else:
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
accounts_to_search = accounts
|
|
|
|
for account in accounts_to_search:
|
|
|
|
if account in accounts:
|
|
|
|
for jid in gajim.contacts.get_jid_list(for_account):
|
|
|
|
item = self._serialized_contacts(gajim.contacts.get_contact(
|
|
|
|
for_account, jid))
|
2005-07-17 23:41:54 +02:00
|
|
|
if item:
|
|
|
|
result.append(item)
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
else:
|
|
|
|
continue
|
2005-07-17 23:41:54 +02:00
|
|
|
# dbus 0.40 does not support return result as empty list
|
|
|
|
if result == []:
|
|
|
|
return None
|
|
|
|
return result
|
|
|
|
|
2005-07-19 16:25:41 +02:00
|
|
|
def toggle_roster_appearance(self, *args):
|
2005-07-17 23:41:54 +02:00
|
|
|
''' shows/hides the roster window '''
|
2005-10-20 13:17:17 +02:00
|
|
|
win = gajim.interface.roster.window
|
2005-07-17 23:41:54 +02:00
|
|
|
if win.get_property('visible'):
|
|
|
|
gobject.idle_add(win.hide)
|
|
|
|
else:
|
|
|
|
win.present()
|
2005-07-20 15:27:27 +02:00
|
|
|
# preserve the 'steal focus preservation'
|
2005-07-17 23:41:54 +02:00
|
|
|
if self._is_first():
|
|
|
|
win.window.focus()
|
|
|
|
else:
|
|
|
|
win.window.focus(long(time()))
|
|
|
|
|
2005-09-09 17:29:32 +02:00
|
|
|
def prefs_list(self, *args):
|
|
|
|
prefs_dict = {}
|
|
|
|
def get_prefs(data, name, path, value):
|
|
|
|
if value is None:
|
|
|
|
return
|
|
|
|
key = ""
|
|
|
|
if path is not None:
|
|
|
|
for node in path:
|
2005-09-09 22:51:22 +02:00
|
|
|
key += node + "#"
|
2005-09-09 17:29:32 +02:00
|
|
|
key += name
|
|
|
|
prefs_dict[key] = unicode(value[1])
|
|
|
|
gajim.config.foreach(get_prefs)
|
|
|
|
return repr(prefs_dict)
|
|
|
|
|
|
|
|
def prefs_store(self, *args):
|
|
|
|
try:
|
2005-10-20 13:17:17 +02:00
|
|
|
gajim.interface.save_config()
|
2005-09-09 17:29:32 +02:00
|
|
|
except Exception, e:
|
|
|
|
return False
|
|
|
|
return True
|
|
|
|
|
|
|
|
def prefs_del(self, *args):
|
2005-09-09 22:51:22 +02:00
|
|
|
[key] = self._get_real_arguments(args, 1)
|
|
|
|
if not key:
|
|
|
|
return False
|
|
|
|
key_path = key.split('#', 2)
|
|
|
|
if len(key_path) != 3:
|
|
|
|
return False
|
|
|
|
if key_path[2] == '*':
|
|
|
|
gajim.config.del_per(key_path[0], key_path[1])
|
|
|
|
else:
|
|
|
|
gajim.config.del_per(key_path[0], key_path[1], key_path[2])
|
|
|
|
return True
|
2005-09-09 17:29:32 +02:00
|
|
|
|
|
|
|
def prefs_put(self, *args):
|
2005-09-09 22:51:22 +02:00
|
|
|
[key] = self._get_real_arguments(args, 1)
|
|
|
|
if not key:
|
|
|
|
return False
|
|
|
|
key_path = key.split('#', 2)
|
|
|
|
if len(key_path) < 3:
|
|
|
|
subname, value = key.split('=', 1)
|
|
|
|
gajim.config.set(subname, value)
|
|
|
|
return True
|
|
|
|
subname, value = key_path[2].split('=', 1)
|
|
|
|
gajim.config.set_per(key_path[0], key_path[1], subname, value)
|
|
|
|
return True
|
2005-09-09 17:29:32 +02:00
|
|
|
|
2005-09-10 00:22:05 +02:00
|
|
|
def add_contact(self, *args):
|
|
|
|
[account] = self._get_real_arguments(args, 1)
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
accounts = gajim.contacts.get_accounts()
|
|
|
|
if account in accounts:
|
2005-10-20 13:17:17 +02:00
|
|
|
AddNewContactWindow(account)
|
2005-09-10 00:22:05 +02:00
|
|
|
return True
|
|
|
|
return False
|
|
|
|
|
|
|
|
def remove_contact(self, *args):
|
|
|
|
[jid, account] = self._get_real_arguments(args, 2)
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
accounts = gajim.contacts.get_accounts()
|
2005-09-10 00:22:05 +02:00
|
|
|
|
|
|
|
# if there is only one account in roster, take it as default
|
|
|
|
if account:
|
|
|
|
accounts = [account]
|
|
|
|
contact_exists = False
|
|
|
|
for account in accounts:
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
contacts = gajim.contacts.get_contact(account, jid)
|
|
|
|
if contacts:
|
2005-09-10 00:22:05 +02:00
|
|
|
gajim.connections[account].unsubscribe(jid)
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
for contact in contacts:
|
2005-10-20 13:17:17 +02:00
|
|
|
gajim.interface.roster.remove_contact(contact, account)
|
Merged in trunk updates, including meta_contacts
Merged revisions 4951,4962-4969 via svnmerge from
svn://svn.gajim.org/gajim/trunk
........
r4951 | nk | 2005-12-30 16:50:36 -0700 (Fri, 30 Dec 2005) | 1 line
fixes in greek transl
........
r4962 | asterix | 2006-01-01 11:41:04 -0700 (Sun, 01 Jan 2006) | 2 lines
merge meta_contacts branch with trunk. Meta contacts are not in gajim yet, but framework is here. We now use gajim.contacts.many_functions() to handle contacts and groupchat_contacts.
........
r4963 | asterix | 2006-01-01 11:43:24 -0700 (Sun, 01 Jan 2006) | 2 lines
correct contacts file
........
r4964 | asterix | 2006-01-01 11:47:26 -0700 (Sun, 01 Jan 2006) | 2 lines
dict.remove() doesn't exists, it's del dict[]
........
r4965 | asterix | 2006-01-01 11:50:15 -0700 (Sun, 01 Jan 2006) | 2 lines
some missing commits from branch
........
r4966 | asterix | 2006-01-01 11:53:30 -0700 (Sun, 01 Jan 2006) | 2 lines
end of gc_contact.nick -> gc_contact.name
........
r4967 | asterix | 2006-01-01 12:05:59 -0700 (Sun, 01 Jan 2006) | 2 lines
new ACE option: send_sha_in_gc_presence that allow to send sha info in groupchat presences
........
r4968 | asterix | 2006-01-01 12:12:36 -0700 (Sun, 01 Jan 2006) | 2 lines
0.9.1-2 in debian that solve the group bug (commit [4924])
........
r4969 | asterix | 2006-01-01 12:31:13 -0700 (Sun, 01 Jan 2006) | 2 lines
typo
........
2006-01-01 21:06:26 +01:00
|
|
|
gajim.contacts.remove_jid(account, jid)
|
2005-09-10 00:22:05 +02:00
|
|
|
contact_exists = True
|
|
|
|
return contact_exists
|
|
|
|
|
2005-07-17 23:41:54 +02:00
|
|
|
def _is_first(self):
|
|
|
|
if self.first_show:
|
|
|
|
self.first_show = False
|
|
|
|
return True
|
|
|
|
return False
|
|
|
|
|
|
|
|
def _get_real_arguments(self, args, desired_length):
|
2005-07-20 15:27:27 +02:00
|
|
|
# supresses the first 'message' argument, which is set in dbus 0.23
|
2005-12-10 01:56:38 +01:00
|
|
|
if dbus_support.version[1] == 20:
|
2005-07-17 23:41:54 +02:00
|
|
|
args=args[1:]
|
|
|
|
if desired_length > 0:
|
|
|
|
args = list(args)
|
|
|
|
args.extend([None] * (desired_length - len(args)))
|
|
|
|
args = args[:desired_length]
|
|
|
|
return args
|
|
|
|
|
|
|
|
def _serialized_contacts(self, contacts):
|
|
|
|
''' get info from list of Contact objects and create a serialized
|
|
|
|
dict for sending it over dbus '''
|
|
|
|
if not contacts:
|
|
|
|
return None
|
|
|
|
prim_contact = None # primary contact
|
|
|
|
for contact in contacts:
|
|
|
|
if prim_contact == None or contact.priority > prim_contact.priority:
|
|
|
|
prim_contact = contact
|
|
|
|
contact_dict = {}
|
|
|
|
contact_dict['name'] = prim_contact.name
|
|
|
|
contact_dict['show'] = prim_contact.show
|
|
|
|
contact_dict['jid'] = prim_contact.jid
|
|
|
|
if prim_contact.keyID:
|
|
|
|
keyID = None
|
|
|
|
if len(prim_contact.keyID) == 8:
|
|
|
|
keyID = prim_contact.keyID
|
|
|
|
elif len(prim_contact.keyID) == 16:
|
|
|
|
keyID = prim_contact.keyID[8:]
|
|
|
|
if keyID:
|
|
|
|
contact_dict['openpgp'] = keyID
|
|
|
|
contact_dict['resources'] = []
|
|
|
|
for contact in contacts:
|
|
|
|
contact_dict['resources'].append(tuple([contact.resource,
|
|
|
|
contact.priority, contact.status]))
|
|
|
|
return repr(contact_dict)
|
|
|
|
|
|
|
|
|
2005-12-10 01:56:38 +01:00
|
|
|
if dbus_support.version[1] >= 30 and dbus_support.version[1] <= 40:
|
2005-07-17 23:41:54 +02:00
|
|
|
method = dbus.method
|
|
|
|
signal = dbus.signal
|
2005-12-10 01:56:38 +01:00
|
|
|
elif dbus_support.version[1] >= 41:
|
2005-07-17 23:41:54 +02:00
|
|
|
method = dbus.service.method
|
|
|
|
signal = dbus.service.signal
|
|
|
|
|
2005-12-10 01:56:38 +01:00
|
|
|
if dbus_support.version[1] >= 30:
|
2005-07-17 23:41:54 +02:00
|
|
|
# prevent using decorators, because they are not supported
|
|
|
|
# on python < 2.4
|
2005-07-19 17:07:00 +02:00
|
|
|
# FIXME: use decorators when python2.3 (and dbus 0.23) is OOOOOOLD
|
2005-07-19 16:25:41 +02:00
|
|
|
toggle_roster_appearance = method(INTERFACE)(toggle_roster_appearance)
|
2005-07-17 23:41:54 +02:00
|
|
|
list_contacts = method(INTERFACE)(list_contacts)
|
|
|
|
list_accounts = method(INTERFACE)(list_accounts)
|
2005-07-18 00:54:24 +02:00
|
|
|
show_next_unread = method(INTERFACE)(show_next_unread)
|
2005-07-17 23:41:54 +02:00
|
|
|
change_status = method(INTERFACE)(change_status)
|
2005-07-20 15:27:27 +02:00
|
|
|
open_chat = method(INTERFACE)(open_chat)
|
2005-07-17 23:41:54 +02:00
|
|
|
contact_info = method(INTERFACE)(contact_info)
|
|
|
|
send_message = method(INTERFACE)(send_message)
|
2005-08-24 01:41:23 +02:00
|
|
|
send_file = method(INTERFACE)(send_file)
|
2005-07-17 23:41:54 +02:00
|
|
|
VcardInfo = signal(INTERFACE)(VcardInfo)
|
2005-09-09 17:29:32 +02:00
|
|
|
prefs_list = method(INTERFACE)(prefs_list)
|
|
|
|
prefs_put = method(INTERFACE)(prefs_put)
|
|
|
|
prefs_del = method(INTERFACE)(prefs_del)
|
|
|
|
prefs_store = method(INTERFACE)(prefs_store)
|
2005-09-10 00:22:05 +02:00
|
|
|
remove_contact = method(INTERFACE)(remove_contact)
|
|
|
|
add_contact = method(INTERFACE)(add_contact)
|
2005-11-30 17:17:06 +01:00
|
|
|
get_status = method(INTERFACE)(get_status)
|
2005-12-30 22:37:36 +01:00
|
|
|
get_status_message = method(INTERFACE)(get_status_message)
|