tools: renamed tools.jid.JID attribute "short" to "bare"
This commit is contained in:
parent
a154d9acbb
commit
36cea6fc91
2 changed files with 94 additions and 94 deletions
|
|
@ -82,7 +82,7 @@ class Chat(Window, QuickChat):
|
|||
header=self.__getHeader(self.content[idx])
|
||||
msg=self.content[idx][2]
|
||||
part=0 #part of the text
|
||||
if JID(self.content[idx][1]).short==self.host.profiles[self.host.profile]['whoami'].short:
|
||||
if JID(self.content[idx][1]).bare==self.host.profiles[self.host.profile]['whoami'].bare:
|
||||
att_header=curses.color_pair(1)
|
||||
else:
|
||||
att_header=curses.color_pair(2)
|
||||
|
|
@ -140,7 +140,7 @@ class Chat(Window, QuickChat):
|
|||
timestamp=str(current_time)
|
||||
if self.last_history and current_time - float(self.last_history) < 5: #FIXME: Q&D fix to avoid double print on new chat window
|
||||
return
|
||||
self.content.append([timestamp,jid.short,msg])
|
||||
self.content.append([timestamp,jid.bare,msg])
|
||||
self.update()
|
||||
|
||||
def handleKey(self, k):
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class ContactList(Window, QuickContactList):
|
|||
def replace(self, jid, groups=None):
|
||||
"""add a contact to the list"""
|
||||
name = self.CM.getAttr(jid,'name')
|
||||
self.jid_list.append(jid.short)
|
||||
self.jid_list.append(jid.bare)
|
||||
self.update()
|
||||
|
||||
def indexUp(self):
|
||||
|
|
@ -131,7 +131,7 @@ class ContactList(Window, QuickContactList):
|
|||
|
||||
def remove(self, jid):
|
||||
"""remove a contact from the list"""
|
||||
self.jid_list.remove(jid.short)
|
||||
self.jid_list.remove(jid.bare)
|
||||
if self.__index >= len(self.jid_list) and self.__index > 0: #if select index is out of border, we put it on the last contact
|
||||
self.__index = len(self.jid_list)-1
|
||||
self.update()
|
||||
|
|
@ -264,8 +264,8 @@ class SortilegeApp(QuickApp):
|
|||
"""Called when a contact is selected in contact list."""
|
||||
jid=JID(jid_txt)
|
||||
debug (_("contact choosed: %s"), jid)
|
||||
self.showChat(jid.short)
|
||||
self.statusBar.remove_item(jid.short)
|
||||
self.showChat(jid.bare)
|
||||
self.statusBar.remove_item(jid.bare)
|
||||
if len(self.statusBar)==0:
|
||||
self.statusBar.hide()
|
||||
self.sizer.update()
|
||||
|
|
@ -298,14 +298,14 @@ class SortilegeApp(QuickApp):
|
|||
QuickApp.newMessage(self, from_jid, msg, type, to_jid, profile)
|
||||
sender=JID(from_jid)
|
||||
addr=JID(to_jid)
|
||||
win = addr if sender.short == self.whoami.short else sender #FIXME: duplicate code with QuickApp
|
||||
win = addr if sender.bare == self.whoami.bare else sender #FIXME: duplicate code with QuickApp
|
||||
if (self.currentChat==None):
|
||||
self.currentChat=win.short
|
||||
self.showChat(win.short)
|
||||
self.currentChat=win.bare
|
||||
self.showChat(win.bare)
|
||||
|
||||
# we show the window in the status bar
|
||||
if not self.currentChat == win.short:
|
||||
self.statusBar.add_item(win.short)
|
||||
if not self.currentChat == win.bare:
|
||||
self.statusBar.add_item(win.bare)
|
||||
self.statusBar.show()
|
||||
self.sizer.update()
|
||||
self.statusBar.update()
|
||||
|
|
|
|||
Loading…
Reference in a new issue