Primitivus: new entities are added to contact list if they send messages + QuickFrontend: names fixes

This commit is contained in:
Goffi 2012-09-26 00:38:41 +02:00
commit 27b2eed139

View file

@ -23,7 +23,6 @@ from logging import debug, info, warning, error
from sat.tools.jid import JID
from sat_frontends.bridge.DBus import DBusBridgeFrontend,BridgeExceptionNoService
from optparse import OptionParser
import pdb
import gettext
gettext.install('sat_frontend', "../i18n", unicode=True)
@ -148,7 +147,7 @@ class QuickApp():
## misc ##
self.profiles[profile]['onlineContact'] = set() #FIXME: temporary
#TODO: gof: manage multi-profiles here
#TODO: manage multi-profiles here
if not self.bridge.isConnected(profile):
self.setStatusOnline(False)
else:
@ -206,7 +205,7 @@ class QuickApp():
if not self.check_profile(profile):
return
debug(_("Disconnected"))
self.contactList.clearContacts()
self.contact_list.clearContacts()
self.setStatusOnline(False)
def connectionError(self, error_type, profile):
@ -471,7 +470,7 @@ class QuickApp():
if not self.check_profile(profile):
return
target = JID(jid)
self.contactList.remove(target)
self.contact_list.remove(target)
try:
self.profiles[profile]['onlineContact'].remove(target.short)
except KeyError:
@ -483,12 +482,12 @@ class QuickApp():
return
if name == "card_nick":
target = JID(data['jid'])
if target in self.contactList:
if target in self.contact_list:
#self.CM.update(target, 'nick', unicode(data['nick']))
self.contact_list._replace(target)
elif name == "card_avatar":
target = JID(data['jid'])
if target in self.contactList:
if target in self.contact_list:
filename = self.bridge.getAvatarFile(data['avatar'])
#self.CM.update(target, 'avatar', filename)
self.contact_list._replace(target)