Changed the TellFeedbackMessage to be a special kind of UserMessage.

It was always a little special, since it's dispatched from the client, but
I want it to be handled like other messages so that we can recolor
different parts of the message as I do in metasoy.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4495 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2007-01-02 21:58:40 +00:00
parent 679030dc2c
commit dca9072595
4 changed files with 14 additions and 12 deletions
@@ -493,9 +493,7 @@ public class ChatDirector extends BasicDirector
var success :Function = function (
idleTime :Long, awayMessage :String) :void
{
var feedback :String = xlate(_bundle, MessageBundle.tcompose(
"m.told_format", target, message));
dispatchMessage(new TellFeedbackMessage(feedback));
dispatchMessage(new TellFeedbackMessage(target, message));
addChatter(target);
if (rl != null) {
rl.requestCompleted(target);
@@ -21,17 +21,19 @@
package com.threerings.crowd.chat.data {
import com.threerings.util.Name;
/**
* A feedback message to indicate that a tell succeeded.
*/
public class TellFeedbackMessage extends ChatMessage
public class TellFeedbackMessage extends UserMessage
{
/**
* A tell feedback message is only composed on the client.
*/
public function TellFeedbackMessage (message :String)
public function TellFeedbackMessage (target :Name, message :String)
{
super(message, null);
super(target, null, message);
setClientInfo(message, ChatCodes.PLACE_CHAT_TYPE);
}
}
@@ -502,7 +502,7 @@ public class ChatDirector extends BasicDirector
// create a listener that will report success or failure
ChatService.TellListener listener = new ChatService.TellListener() {
public void tellSucceeded (long idletime, String awayMessage) {
success(xlate(_bundle, MessageBundle.tcompose("m.told_format", target, message)));
success();
// if they have an away message, report that
if (awayMessage != null) {
@@ -524,8 +524,8 @@ public class ChatDirector extends BasicDirector
}
}
protected void success (String feedback) {
dispatchMessage(new TellFeedbackMessage(feedback));
protected void success () {
dispatchMessage(new TellFeedbackMessage(target, message));
addChatter(target);
if (rl != null) {
rl.requestCompleted(target);
@@ -21,17 +21,19 @@
package com.threerings.crowd.chat.data;
import com.threerings.util.Name;
/**
* A feedback message to indicate that a tell succeeded.
*/
public class TellFeedbackMessage extends ChatMessage
public class TellFeedbackMessage extends UserMessage
{
/**
* A tell feedback message is only composed on the client.
*/
public TellFeedbackMessage (String message)
public TellFeedbackMessage (Name target, String message)
{
super(message, null);
super(target, null, message, ChatCodes.DEFAULT_MODE);
setClientInfo(message, ChatCodes.PLACE_CHAT_TYPE);
}
}