com.threerings.crowd.chat.data
Class UserMessage

java.lang.Object
  extended by com.threerings.crowd.chat.data.ChatMessage
      extended by com.threerings.crowd.chat.data.UserMessage
All Implemented Interfaces:
Streamable
Direct Known Subclasses:
TellFeedbackMessage

public class UserMessage
extends ChatMessage

A ChatMessage representing a message that came from another user.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
Streamable.Closure
 
Field Summary
 byte mode
          The mode of the message.
 Name speaker
          The user that the message came from.
 
Fields inherited from class com.threerings.crowd.chat.data.ChatMessage
bundle, localtype, message, timestamp
 
Constructor Summary
UserMessage(Name speaker, String bundle, String message, byte mode)
          Construct a user message.
 
Method Summary
static UserMessage create(Name speaker, String message)
          Constructs a user message for a player originated tell (which has no bundle and is in the default mode).
 String getFormat()
          Get the appropriate message format for this message.
 Name getSpeakerDisplayName()
          Returns the name to display for the speaker.
 
Methods inherited from class com.threerings.crowd.chat.data.ChatMessage
setClientInfo, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

speaker

public Name speaker
The user that the message came from.


mode

public byte mode
The mode of the message. @see ChatCodes.DEFAULT_MODE

Constructor Detail

UserMessage

public UserMessage(Name speaker,
                   String bundle,
                   String message,
                   byte mode)
Construct a user message.

Method Detail

create

public static UserMessage create(Name speaker,
                                 String message)
Constructs a user message for a player originated tell (which has no bundle and is in the default mode).


getSpeakerDisplayName

public Name getSpeakerDisplayName()
Returns the name to display for the speaker. Some types of messages may wish to not use the canonical name for the speaker and should thus override this function.


getFormat

public String getFormat()
Description copied from class: ChatMessage
Get the appropriate message format for this message.

Overrides:
getFormat in class ChatMessage