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:
@@ -21,6 +21,8 @@
|
||||
|
||||
package com.threerings.crowd.chat.server;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -31,6 +33,8 @@ import com.google.common.collect.Sets;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
import com.threerings.presents.server.PresentsDObjectMgr;
|
||||
import com.threerings.util.Name;
|
||||
|
||||
@@ -67,6 +71,17 @@ public class ChatHistory
|
||||
this.channel = channel;
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user