tools: renamed tools.jid.JID attribute "short" to "bare"

This commit is contained in:
souliane 2013-10-29 16:26:55 +01:00
commit 36cea6fc91
3 changed files with 94 additions and 94 deletions

View file

@ -199,7 +199,7 @@ class Chat(wx.Frame, QuickChat):
def onEnterPressed(self, event):
"""Behaviour when enter pressed in send line."""
self.host.sendMessage(self.target.short if self.type == 'group' else self.target,
self.host.sendMessage(self.target.bare if self.type == 'group' else self.target,
event.GetString(),
mess_type="groupchat" if self.type == 'group' else "chat",
profile_key=self.host.profile)
@ -257,9 +257,9 @@ class Chat(wx.Frame, QuickChat):
if filename:
debug(_("filename: %s"),filename)
#FIXME: check last_resource: what if self.target.resource exists ?
last_resource = self.host.bridge.getLastResource(unicode(self.target.short), self.host.profile)
last_resource = self.host.bridge.getLastResource(unicode(self.target.bare), self.host.profile)
if last_resource:
full_jid = JID("%s/%s" % (self.target.short, last_resource))
full_jid = JID("%s/%s" % (self.target.bare, last_resource))
else:
full_jid = self.target
id = self.host.bridge.sendFile(full_jid, filename, {}, self.host.profile)

View file

@ -65,7 +65,7 @@ class ContactList(wx.SimpleHtmlListBox, QuickContactList):
@return: list of indexes"""
result=[]
for i in range(self.GetCount()):
if (type(entity) == JID and type(self.GetClientData(i)) == JID and self.GetClientData(i).short == entity.short) or\
if (type(entity) == JID and type(self.GetClientData(i)) == JID and self.GetClientData(i).bare == entity.bare) or\
self.GetClientData(i) == entity:
result.append(i)
return result
@ -136,7 +136,7 @@ class ContactList(wx.SimpleHtmlListBox, QuickContactList):
</td>
</table>
""" % (avatar,
escape(nick or name or jid.node or jid.short),
escape(nick or name or jid.node or jid.bare),
show_html,
escape(status))

View file

@ -339,10 +339,10 @@ class MainWindow(wx.Frame, QuickApp):
def onContactActivated(self, jid):
debug (_("onContactActivated: %s"), jid)
if self.chat_wins[jid.short].IsShown():
self.chat_wins[jid.short].Hide()
if self.chat_wins[jid.bare].IsShown():
self.chat_wins[jid.bare].Hide()
else:
self.chat_wins[jid.short].Show()
self.chat_wins[jid.bare].Show()
def onConnectRequest(self, e):
self.bridge.connect(self.profile)
@ -394,7 +394,7 @@ class MainWindow(wx.Frame, QuickApp):
if dlg.ShowModal() == wx.ID_OK:
jid=JID(dlg.GetValue())
if jid.is_valid():
self.bridge.addContact(jid.short, profile_key=self.profile)
self.bridge.addContact(jid.bare, profile_key=self.profile)
else:
error (_("'%s' is an invalid JID !"), jid)
#TODO: notice the user
@ -413,14 +413,14 @@ class MainWindow(wx.Frame, QuickApp):
dlg.Destroy()
return
dlg = wx.MessageDialog(self, _("Are you sure you want to delete %s from your roster list ?") % target.short,
dlg = wx.MessageDialog(self, _("Are you sure you want to delete %s from your roster list ?") % target.bare,
_('Contact suppression'),
wx.YES_NO | wx.ICON_QUESTION
)
if dlg.ShowModal() == wx.ID_YES:
info(_("Unsubscribing %s presence"), target.short)
self.bridge.delContact(target.short, profile_key=self.profile)
info(_("Unsubscribing %s presence"), target.bare)
self.bridge.delContact(target.bare, profile_key=self.profile)
dlg.Destroy()
@ -435,7 +435,7 @@ class MainWindow(wx.Frame, QuickApp):
dlg.ShowModal()
dlg.Destroy()
return
_id = self.bridge.getCard(target.short, profile_key=self.profile)
_id = self.bridge.getCard(target.bare, profile_key=self.profile)
self.current_action_ids.add(_id)
self.current_action_ids_cb[_id] = self.onProfileReceived