Don't double note UserMessage instead specifically note tells() which is

the only circumstance where we're not getting sent our own message back to
us.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2654 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-06-14 00:55:19 +00:00
parent e6dc5c38d7
commit 61168c737c
2 changed files with 10 additions and 11 deletions
@@ -1,5 +1,5 @@
//
// $Id: ChatProvider.java,v 1.19 2003/06/03 21:41:33 ray Exp $
// $Id: ChatProvider.java,v 1.20 2003/06/14 00:55:19 mdb Exp $
package com.threerings.crowd.chat.server;
@@ -125,8 +125,12 @@ public class ChatProvider
public static void sendTellMessage (
BodyObject target, String speaker, String bundle, String message)
{
SpeakProvider.sendMessage(target,
new UserMessage(message, bundle, speaker, DEFAULT_MODE));
UserMessage msg =
new UserMessage(message, bundle, speaker, DEFAULT_MODE);
SpeakProvider.sendMessage(target, msg);
// note that the teller "heard" what they said
SpeakProvider.noteMessage(speaker, msg);
}
/** The distributed object manager used by the chat services. */
@@ -1,5 +1,5 @@
//
// $Id: SpeakProvider.java,v 1.7 2003/06/14 00:47:16 mdb Exp $
// $Id: SpeakProvider.java,v 1.8 2003/06/14 00:55:19 mdb Exp $
package com.threerings.crowd.chat.server;
@@ -219,12 +219,6 @@ public class SpeakProvider
Log.info("Unable to note listeners [dclass=" + speakObj.getClass() +
", msg=" + msg + "].");
}
// if this is a user message, note the message in their history as
// well
if (msg instanceof UserMessage) {
noteMessage(((UserMessage)msg).speaker, msg);
}
}
/**
@@ -243,7 +237,7 @@ public class SpeakProvider
*/
public static void clearHistory (String username)
{
Log.info("Clearing history for " + username + ".");
// Log.info("Clearing history for " + username + ".");
_histories.remove(username);
}
@@ -258,6 +252,7 @@ public class SpeakProvider
msg.timestamp = System.currentTimeMillis();
}
getHistoryList(username).add(msg);
// Log.info("Noted that " + username + " heard " + msg + ".");
}
/**