Parse text emoticons

This commit is contained in:
Marco Pesenti Gritti 2006-05-21 20:37:29 -04:00
parent 58d6cbd76f
commit 1a2f5cc3f7

View File

@ -19,6 +19,7 @@ from sugar.p2p.Stream import Stream
from sugar.session.LogWriter import LogWriter from sugar.session.LogWriter import LogWriter
from sugar.chat.sketchpad.Toolbox import Toolbox from sugar.chat.sketchpad.Toolbox import Toolbox
from sugar.chat.sketchpad.SketchPad import SketchPad from sugar.chat.sketchpad.SketchPad import SketchPad
from sugar.chat.Emoticons import Emoticons
import sugar.env import sugar.env
import richtext import richtext
@ -192,6 +193,8 @@ class Chat(activity.Activity):
# FIXME self._controller.notify_activate(self) # FIXME self._controller.notify_activate(self)
def _insert_rich_message(self, nick, msg): def _insert_rich_message(self, nick, msg):
msg = Emoticons.get_instance().replace(msg)
buf = self._chat_view.get_buffer() buf = self._chat_view.get_buffer()
aniter = buf.get_end_iter() aniter = buf.get_end_iter()
buf.insert(aniter, nick + ": ") buf.insert(aniter, nick + ": ")