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:
@@ -493,9 +493,7 @@ public class ChatDirector extends BasicDirector
|
|||||||
var success :Function = function (
|
var success :Function = function (
|
||||||
idleTime :Long, awayMessage :String) :void
|
idleTime :Long, awayMessage :String) :void
|
||||||
{
|
{
|
||||||
var feedback :String = xlate(_bundle, MessageBundle.tcompose(
|
dispatchMessage(new TellFeedbackMessage(target, message));
|
||||||
"m.told_format", target, message));
|
|
||||||
dispatchMessage(new TellFeedbackMessage(feedback));
|
|
||||||
addChatter(target);
|
addChatter(target);
|
||||||
if (rl != null) {
|
if (rl != null) {
|
||||||
rl.requestCompleted(target);
|
rl.requestCompleted(target);
|
||||||
|
|||||||
@@ -21,17 +21,19 @@
|
|||||||
|
|
||||||
package com.threerings.crowd.chat.data {
|
package com.threerings.crowd.chat.data {
|
||||||
|
|
||||||
|
import com.threerings.util.Name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A feedback message to indicate that a tell succeeded.
|
* 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.
|
* 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);
|
setClientInfo(message, ChatCodes.PLACE_CHAT_TYPE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ public class ChatDirector extends BasicDirector
|
|||||||
// create a listener that will report success or failure
|
// create a listener that will report success or failure
|
||||||
ChatService.TellListener listener = new ChatService.TellListener() {
|
ChatService.TellListener listener = new ChatService.TellListener() {
|
||||||
public void tellSucceeded (long idletime, String awayMessage) {
|
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 they have an away message, report that
|
||||||
if (awayMessage != null) {
|
if (awayMessage != null) {
|
||||||
@@ -524,8 +524,8 @@ public class ChatDirector extends BasicDirector
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void success (String feedback) {
|
protected void success () {
|
||||||
dispatchMessage(new TellFeedbackMessage(feedback));
|
dispatchMessage(new TellFeedbackMessage(target, message));
|
||||||
addChatter(target);
|
addChatter(target);
|
||||||
if (rl != null) {
|
if (rl != null) {
|
||||||
rl.requestCompleted(target);
|
rl.requestCompleted(target);
|
||||||
|
|||||||
@@ -21,17 +21,19 @@
|
|||||||
|
|
||||||
package com.threerings.crowd.chat.data;
|
package com.threerings.crowd.chat.data;
|
||||||
|
|
||||||
|
import com.threerings.util.Name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A feedback message to indicate that a tell succeeded.
|
* 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.
|
* 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);
|
setClientInfo(message, ChatCodes.PLACE_CHAT_TYPE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user