quick frontend, primitivus, wix: MUC private messages management

/!\ not fully finished, backend part is not done yet /!\
    - as resources are discarded to manage chat windows lists, a pretty dirty hack is done to work around this:
      full jid is escaped using a prefix (it becomes invalid and resource is preserved).
    - new quick_utils module, with helper methods. escapePrivate and unescapePrivate implementations
    - MUC private messages are not managed in Wix yet
This commit is contained in:
Goffi 2012-10-11 00:48:35 +02:00
commit 8ad8ca1933
3 changed files with 163 additions and 77 deletions

View file

@ -201,7 +201,7 @@ class Chat(wx.Frame, QuickChat):
def onEnterPressed(self, event):
"""Behaviour when enter pressed in send line."""
self.host.bridge.sendMessage(self.target.short if self.type=='group' else self.target,
self.host.sendMessage(self.target.short if self.type=='group' else self.target,
event.GetString(),
mess_type = "groupchat" if self.type=='group' else "chat",
profile_key=self.host.profile)

View file

@ -169,8 +169,7 @@ class ContactList(wx.SimpleHtmlListBox, QuickContactList):
self.Insert(_present, gp_idx+1, contact)
def setSpecial(self, special_jid, special_type):
pass
QuickContactList.setSpecial(self, special_jid, special_type)
def remove(self, contact):
"""remove a contact from the list"""

View file

@ -22,7 +22,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
from sat_frontends.quick_frontend.quick_chat_list import QuickChatList
from sat_frontends.quick_frontend.quick_app import QuickApp
from sat_frontends.quick_frontend.quick_contact_management import QuickContactManagement
import wx
from sat_frontends.wix.contact_list import ContactList
from sat_frontends.wix.chat import Chat
@ -31,9 +30,7 @@ from sat_frontends.wix.xmlui import XMLUI
from sat_frontends.wix.gateways import GatewaysManager
from sat_frontends.wix.profile import Profile
from sat_frontends.wix.profile_manager import ProfileManager
import gobject
import os.path
import pdb
from sat.tools.jid import JID
from logging import debug, info, warning, error
import sat_frontends.wix.constants
@ -52,9 +49,6 @@ idFIND_GATEWAYS = range(10)
class ChatList(QuickChatList):
"""This class manage the list of chat windows"""
def __init__(self, host):
QuickChatList.__init__(self, host)
def createChat(self, target):
return Chat(target, self.host)
@ -186,8 +180,8 @@ class MainWindow(wx.Frame, QuickApp):
wx.EVT_MENU(self, idFIND_GATEWAYS, self.onFindGateways)
def newMessage(self, from_jid, msg, type, to_jid, profile):
QuickApp.newMessage(self, from_jid, msg, type, to_jid, profile)
def newMessage(self, from_jid, to_jid, msg, _type, profile):
QuickApp.newMessage(self, from_jid, to_jid, msg, _type, profile)
def showAlert(self, message):
# TODO: place this in a separate class