7 class TextChannel(telepathy.server.ChannelTypeText):
9 Look into implementing ChannelInterfaceMessages for rich text formatting
12 def __init__(self, connection, conversation):
14 self._conversation = conversation
15 self._connRef = weakref.ref(connection)
17 telepathy.server.ChannelTypeText.__init__(self, connection, None)
19 self.GroupFlagsChanged(telepathy.CHANNEL_GROUP_FLAG_CAN_ADD, 0)
20 self.__add_initial_participants()
22 def Send(self, messageType, text):
23 if messageType == telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL:
24 self._conversation.send_text_message(text)
25 elif messageType == telepathy.CHANNEL_TEXT_MESSAGE_TYPE_ACTION and text == u"nudge":
26 self._conversation.send_nudge()
28 raise telepathy.NotImplemented("Unhandled message type")
29 self.Sent(int(time.time()), messageType, text)
32 self._conversation.leave()
33 telepathy.server.ChannelTypeText.Close(self)
34 self.remove_from_connection()