partial fixes

This commit is contained in:
Nikos Kouremenos 2005-03-02 20:27:09 +00:00
parent 832872f547
commit 036c476127
3 changed files with 19 additions and 18 deletions

View File

@ -1171,7 +1171,7 @@ class agent_registration_window:
send registration info to the core""" send registration info to the core"""
for name in self.entries.keys(): for name in self.entries.keys():
self.infos[name] = self.entries[name].get_text() self.infos[name] = self.entries[name].get_text()
user1 = gtkgui.user(self.agent, self.agent, ['Agents'], 'offline', \ user1 = gtkgui.User(self.agent, self.agent, ['Agents'], 'offline', \
'offline', 'from', '', '', 0, '') 'offline', 'from', '', '', 0, '')
self.plugin.roster.contacts[self.account][self.agent] = [user1] self.plugin.roster.contacts[self.account][self.agent] = [user1]
self.plugin.roster.add_user_to_roster(self.agent, self.account) self.plugin.roster.add_user_to_roster(self.agent, self.account)

View File

@ -575,19 +575,20 @@ class new_message_window: #FIXME: NOT READY
def on_chat_button_clicked(self, widget): def on_chat_button_clicked(self, widget):
"""When Chat button is clicked""" """When Chat button is clicked"""
print 'chat btn clicked' #FIXME: either make it simple entry, or find a way to handle windows the easy way
userid = self.xml.get_widget('userid_comboboxentry').child.get_text() userid = self.xml.get_widget('userid_comboboxentry').child.get_text()
#FIXME: if the user doesn't give jid, but name look in the roster #FIXME: if the user doesn't give jid, but name look in the roster
#DO IT WITH AUTOCOMPLETE #DO IT WITH AUTOCOMPLETE
#SO USER ID SHOULD BECOME JID and sent to new_chat() #SO USER ID SHOULD BECOME JID and sent to new_chat()
jid = userid jid = userid
user = gtkgui.user(jid, name .....) # use User class, new_chat expects it that way
user = gtkgui.User((jid, jid, ['not in the roster'], \
# use User class, new_chat expects that 'not in the roster', 'not in the roster', 'none', None, '', 0, ''))
user().jid = jid self.plugin.contacts[self.account][jid] = [user]
#FIXME: don't add him if we already have him (see on_message code on gtkgui.py)
self.plugin.roster.new_chat(jid, self.account) self.plugin.roster.add_user_to_roster(user.jid, self.account)
self.plugin.roster.new_chat(user.jid, self.account)
widget.get_toplevel().destroy() widget.get_toplevel().destroy()
def __init__(self, plugin, account): def __init__(self, plugin, account):

View File

@ -162,7 +162,7 @@ class ImageCellRenderer(gtk.GenericCellRenderer):
gobject.type_register(ImageCellRenderer) gobject.type_register(ImageCellRenderer)
class user: class User:
"""Information concerning each users""" """Information concerning each users"""
def __init__(self, *args): def __init__(self, *args):
if len(args) == 0: if len(args) == 0:
@ -1416,7 +1416,7 @@ class roster_window:
if user.ask == 'subscribe': if user.ask == 'subscribe':
img = self.pixbufs['requested'] img = self.pixbufs['requested']
else: else:
img = self.pixbufs['not in list'] img = self.pixbufs['not in the roster']
else: else:
img = self.pixbufs[user.show] img = self.pixbufs[user.show]
model.set_value(iter, 0, img) model.set_value(iter, 0, img)
@ -1517,7 +1517,7 @@ class roster_window:
if not show: if not show:
show = 'offline' show = 'offline'
user1 = user(ji, name, array[jid]['groups'], show, \ user1 = User(ji, name, array[jid]['groups'], show, \
array[jid]['status'], array[jid]['sub'], array[jid]['ask'], \ array[jid]['status'], array[jid]['sub'], array[jid]['ask'], \
resource, 0, '') resource, 0, '')
#when we draw the roster, we can't have twice the same user with #when we draw the roster, we can't have twice the same user with
@ -1968,8 +1968,8 @@ class roster_window:
def on_message(self, jid, msg, tim, account): def on_message(self, jid, msg, tim, account):
"""when we receive a message""" """when we receive a message"""
if not self.contacts[account].has_key(jid): if not self.contacts[account].has_key(jid):
user1 = user(jid, jid, ['not in list'], \ user1 = User(jid, jid, ['not in the roster'], \
'not in list', 'not in list', 'none', None, '', 0, '') 'not in the roster', 'not in the roster', 'none', None, '', 0, '')
self.contacts[account][jid] = [user1] self.contacts[account][jid] = [user1]
self.add_user_to_roster(jid, account) self.add_user_to_roster(jid, account)
iters = self.get_user_iter(jid, account) iters = self.get_user_iter(jid, account)
@ -2212,7 +2212,7 @@ class roster_window:
self.pixbufs = {} self.pixbufs = {}
for state in ('connecting', 'online', 'chat', 'away', 'xa', 'dnd', \ for state in ('connecting', 'online', 'chat', 'away', 'xa', 'dnd', \
'invisible', 'offline', 'error', 'requested', 'message', 'opened', \ 'invisible', 'offline', 'error', 'requested', 'message', 'opened', \
'closed', 'not in list'): 'closed', 'not in the roster'):
# try to open a pixfile with the correct method # try to open a pixfile with the correct method
state_file = state.replace(" ", "_") state_file = state.replace(" ", "_")
files = [] files = []
@ -2756,7 +2756,7 @@ class plugin:
if (resources != [''] and (len(luser) != 1 or if (resources != [''] and (len(luser) != 1 or
luser[0].show != 'offline')) and not string.find(jid, "@") <= 0: luser[0].show != 'offline')) and not string.find(jid, "@") <= 0:
old_show = 0 old_show = 0
user1 = user(user1.jid, user1.name, user1.groups, user1.show, \ user1 = User(user1.jid, user1.name, user1.groups, user1.show, \
user1.status, user1.sub, user1.ask, user1.resource, \ user1.status, user1.sub, user1.ask, user1.resource, \
user1.priority, user1.keyID) user1.priority, user1.keyID)
luser.append(user1) luser.append(user1)
@ -2825,14 +2825,14 @@ class plugin:
u = self.roster.contacts[account][jid][0] u = self.roster.contacts[account][jid][0]
u.resource = array[1] u.resource = array[1]
self.roster.remove_user(u, account) self.roster.remove_user(u, account)
if 'not in list' in u.groups: if 'not in the roster' in u.groups:
u.groups.remove('not in list') u.groups.remove('not in the roster')
if len(u.groups) == 0: if len(u.groups) == 0:
u.groups = ['general'] u.groups = ['general']
self.roster.add_user_to_roster(u.jid, account) self.roster.add_user_to_roster(u.jid, account)
self.send('UPDUSER', account, (u.jid, u.name, u.groups)) self.send('UPDUSER', account, (u.jid, u.name, u.groups))
else: else:
user1 = user(jid, jid, ['general'], 'online', \ user1 = User(jid, jid, ['general'], 'online', \
'online', 'to', '', array[1], 0, '') 'online', 'to', '', array[1], 0, '')
self.roster.contacts[account][jid] = [user1] self.roster.contacts[account][jid] = [user1]
self.roster.add_user_to_roster(jid, account) self.roster.add_user_to_roster(jid, account)