core, quick frontend, plugin xep-0054, bridge: use of memory's entities data for vcard:

- bridge: new bridge method getEntityData and signal entityDataUpdated
	- core: entityDataUpdated signal sent on new string data
	- quick frontend: fixed avatars/vcard infos, fixed _replace in quick_contact_list
	- plugin xep-0054: dropped updatedValue signal, use entities data instead
This commit is contained in:
Goffi 2012-09-26 01:23:56 +02:00
commit 0f6de78a3b
2 changed files with 76 additions and 80 deletions

View file

@ -139,6 +139,11 @@ class DbusObject(dbus.service.Object):
def disconnected(self, profile):
pass
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
signature='ssss')
def entityDataUpdated(self, jid, name, value, profile):
pass
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
signature='ssss')
def newAlert(self, message, title, alert_type, profile):
@ -169,11 +174,6 @@ class DbusObject(dbus.service.Object):
def subscribe(self, sub_type, entity_jid, profile):
pass
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
signature='sa{ss}s')
def updatedValue(self, name, value, profile):
pass
### methods ###
@ -261,6 +261,12 @@ class DbusObject(dbus.service.Object):
def getContactsFromGroup(self, group, profile_key="@DEFAULT@"):
return self._callback("getContactsFromGroup", unicode(group), unicode(profile_key))
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='sass', out_signature='a{ss}',
async_callbacks=None)
def getEntityData(self, jid, keys, profile):
return self._callback("getEntityData", unicode(jid), keys, unicode(profile))
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='ssib', out_signature='a(dsss)',
async_callbacks=('callback', 'errback'))
@ -518,6 +524,9 @@ class DBusBridge(Bridge):
def disconnected(self, profile):
self.dbus_bridge.disconnected(profile)
def entityDataUpdated(self, jid, name, value, profile):
self.dbus_bridge.entityDataUpdated(jid, name, value, profile)
def newAlert(self, message, title, alert_type, profile):
self.dbus_bridge.newAlert(message, title, alert_type, profile)
@ -536,9 +545,6 @@ class DBusBridge(Bridge):
def subscribe(self, sub_type, entity_jid, profile):
self.dbus_bridge.subscribe(sub_type, entity_jid, profile)
def updatedValue(self, name, value, profile):
self.dbus_bridge.updatedValue(name, value, profile)
def register(self, name, callback):
debug("registering DBus bridge method [%s]", name)

View file

@ -136,14 +136,15 @@ doc_param_0=answer_type: Same as for [actionResult] but with the following addit
doc_param_1=id: Id of the action
doc_param_2=data: answer_type specific data
[updatedValue]
[entityDataUpdated]
type=signal
category=core
sig_in=sa{ss}s
doc=A value has been updated
doc_param_0=name: Name of the updated value
doc_param_1=value: New value
doc_param_2=%(doc_profile)s
sig_in=ssss
doc=An entity's data has been updated
doc_param_0=jid: entity's bare jid
doc_param_1=name: Name of the updated value
doc_param_2=value: New value
doc_param_3=%(doc_profile)s
;methods
@ -171,6 +172,18 @@ sig_in=
sig_out=as
doc=Get all profiles
[getEntityData]
type=method
category=core
sig_in=sass
sig_out=a{ss}
doc=Get data for an entity
doc_param_0=jid: entity's bare jid
doc_param_1=keys: list of keys to get
doc_param_2=%(doc_profile)s
doc_return=dictionary of asked key,
if key doesn't exist, the resulting dictionary will neither have the key
[createProfile]
deprecated=
type=method