diff --git a/sugar/chat/chat.py b/sugar/chat/chat.py
index 9fab3af9..dc441c13 100755
--- a/sugar/chat/chat.py
+++ b/sugar/chat/chat.py
@@ -57,7 +57,7 @@ class Chat(activity.Activity):
return vbox
def __send_button_clicked_cb(self, button):
- print self._sketchpad.to_svg()
+ self.send_sketch(self._sketchpad.to_svg())
def _tool_selected(self, toolbox, tool_id):
if tool_id == 'text':
@@ -197,13 +197,54 @@ class Chat(activity.Activity):
aniter = buf.get_end_iter()
buf.insert(aniter, "\n")
- def _insert_sketch(self, sketch):
+ def _insert_sketch(self, buddy, svgdata):
"""Insert a sketch object into the chat buffer."""
- pass
+ print "Got SVG: %s" % svgdata[:50]
+
+ def _get_first_richtext_chunk(self, msg):
+ rt_last = -1
+ tag_rt_start = ""
+ tag_rt_end = ""
+ rt_first = msg.find(tag_rt_start)
+ length = -1
+ if rt_first >= 0:
+ length = len(msg)
+ rt_last = msg.find(tag_rt_end, rt_first)
+ if rt_first >= 0 and rt_last >= (rt_first + len(tag_rt_start)) and length > 0:
+ return msg[rt_first:rt_last + len(tag_rt_end)]
+ return None
+
+ def _get_first_sketch_chunk(self, msg):
+ svg_last = -1
+ tag_svg_start = "