projects
/
theonering
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
76f6f41
)
Being more paranoied about marking as read and using the server timestamp
author
Ed Page
<eopage@byu.net>
Sat, 3 Apr 2010 14:12:02 +0000
(09:12 -0500)
committer
Ed Page
<eopage@byu.net>
Sat, 3 Apr 2010 14:12:02 +0000
(09:12 -0500)
src/channel/text.py
patch
|
blob
|
history
diff --git
a/src/channel/text.py
b/src/channel/text.py
index
3b9b159
..
94ae255
100644
(file)
--- a/
src/channel/text.py
+++ b/
src/channel/text.py
@@
-134,7
+134,7
@@
class TextChannel(tp.ChannelTypeText):
return
messages = [
return
messages = [
- newMessage
+ (newMessage, newConversation.time)
for newConversation in newConversations
for newMessage in newConversation.messages
if not gvoice.conversations.is_message_from_self(newMessage)
for newConversation in newConversations
for newMessage in newConversation.messages
if not gvoice.conversations.is_message_from_self(newMessage)
@@
-144,19
+144,19
@@
class TextChannel(tp.ChannelTypeText):
"How did this happen for %r?" % (self._contactKey, )
)
return
"How did this happen for %r?" % (self._contactKey, )
)
return
- for newMessage in messages:
+ for newMessage, convTime in messages:
formattedMessage = self._format_message(newMessage)
formattedMessage = self._format_message(newMessage)
- self._report_new_message(formattedMessage)
+ self._report_new_message(formattedMessage, convTime)
- for conv in newConversations:
+ for conv in mergedConversations.conversations:
conv.isRead = True
def _format_message(self, message):
return " ".join(part.text.strip() for part in message.body)
conv.isRead = True
def _format_message(self, message):
return " ".join(part.text.strip() for part in message.body)
- def _report_new_message(self, message):
+ def _report_new_message(self, message, convTime):
currentReceivedId = self.__nextRecievedId
currentReceivedId = self.__nextRecievedId
- timestamp = int(time.time())
+ timestamp = time.mktime(convTime.timetuple())
type = telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL
_moduleLogger.info("Received message from User %r" % self.__otherHandle)
type = telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL
_moduleLogger.info("Received message from User %r" % self.__otherHandle)