Preserve message timestamps when we send them between peers.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6692 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Andrzej Kapolka
2011-08-12 21:09:23 +00:00
parent be828f5dbc
commit 7a8704f7a0
@@ -21,6 +21,8 @@
package com.threerings.crowd.chat.server; package com.threerings.crowd.chat.server;
import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@@ -31,6 +33,8 @@ import com.google.common.collect.Sets;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.google.inject.Singleton; import com.google.inject.Singleton;
import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream;
import com.threerings.presents.server.PresentsDObjectMgr; import com.threerings.presents.server.PresentsDObjectMgr;
import com.threerings.util.Name; import com.threerings.util.Name;
@@ -67,6 +71,17 @@ public class ChatHistory
this.channel = channel; this.channel = channel;
this.message = message; this.message = message;
} }
public void writeObject (ObjectOutputStream out) throws IOException {
// ChatMessage.timestamp is transient, so write it externally
out.defaultWriteObject();
out.writeLong(message.timestamp);
}
public void readObject (ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
message.timestamp = in.readLong();
}
} }
/** /**