projects
/
theonering
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixing typo bugs, weak dictionary bugs, adding logging, handle type enforcement, etc
[theonering]
/
src
/
channel
/
text.py
diff --git
a/src/channel/text.py
b/src/channel/text.py
index
e6cc6af
..
e882bfd
100644
(file)
--- a/
src/channel/text.py
+++ b/
src/channel/text.py
@@
-3,38
+3,24
@@
import weakref
import telepathy
import telepathy
-import handle
+class TextChannel(telepathy.server.ChannelTypeText):
+ """
+ Look into implementing ChannelInterfaceMessages for rich text formatting
+ """
-class ButterflyTextChannel(
- telepathy.server.ChannelTypeText,
- telepathy.server.ChannelInterfaceGroup,
- telepathy.server.ChannelInterfaceChatState
- ):
-
- def __init__(self, connection, conversation):
+ def __init__(self, connection):
self._recv_id = 0
self._recv_id = 0
- self._conversation = conversation
- self._conn_ref = weakref.ref(connection)
+ self._connRef = weakref.ref(connection)
telepathy.server.ChannelTypeText.__init__(self, connection, None)
telepathy.server.ChannelTypeText.__init__(self, connection, None)
- telepathy.server.ChannelInterfaceGroup.__init__(self)
- telepathy.server.ChannelInterfaceChatState.__init__(self)
self.GroupFlagsChanged(telepathy.CHANNEL_GROUP_FLAG_CAN_ADD, 0)
self.__add_initial_participants()
self.GroupFlagsChanged(telepathy.CHANNEL_GROUP_FLAG_CAN_ADD, 0)
self.__add_initial_participants()
- def SetChatState(self, state):
- if state == telepathy.CHANNEL_CHAT_STATE_COMPOSING:
- self._conversation.send_typing_notification()
- h = handle.create_handle(self._conn_ref(), 'self')
- self.ChatStateChanged(h, state)
-
def Send(self, messageType, text):
if messageType == telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL:
def Send(self, messageType, text):
if messageType == telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL:
- self._conversation.send_text_message(text)
- elif messageType == telepathy.CHANNEL_TEXT_MESSAGE_TYPE_ACTION and text == u"nudge":
- self._conversation.send_nudge()
+ pass
else:
raise telepathy.NotImplemented("Unhandled message type")
self.Sent(int(time.time()), messageType, text)
else:
raise telepathy.NotImplemented("Unhandled message type")
self.Sent(int(time.time()), messageType, text)