telepathyClient: Use sent timestamp instead of received timestamp
It's generally more useful to see when a person sent a message instead of when we received it. Also, a recent change in Telepathy made the received timestamp be 0 for messages we send. https://bugzilla.gnome.org/show_bug.cgi?id=640271
This commit is contained in:
parent
b7fd78b254
commit
712ea9b9b6
@ -44,11 +44,16 @@ let contactFeatures = [Tp.ContactFeature.ALIAS,
|
||||
|
||||
function makeMessageFromTpMessage(tpMessage, direction) {
|
||||
let [text, flags] = tpMessage.to_text();
|
||||
|
||||
let timestamp = tpMessage.get_sent_timestamp();
|
||||
if (timestamp == 0)
|
||||
timestamp = tpMessage.get_received_timestamp();
|
||||
|
||||
return {
|
||||
messageType: tpMessage.get_message_type(),
|
||||
text: text,
|
||||
sender: tpMessage.sender.alias,
|
||||
timestamp: tpMessage.get_received_timestamp(),
|
||||
timestamp: timestamp,
|
||||
direction: direction
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user