|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.crowd.chat.server.ChatHistory
public class ChatHistory
Provides a server-wide history of chat messages.
| Nested Class Summary | |
|---|---|
static class |
ChatHistory.Entry
Recorded parcel of chat for historical purposes, maintained by record(ChatChannel, UserMessage, Name...),
get(Name), and clear(Name). |
| Field Summary | |
|---|---|
protected Map<Name,List<ChatHistory.Entry>> |
_histories
Recent chat history for the server. |
protected Set<Name> |
_holds
Names we will hold for. |
protected PresentsDObjectMgr |
_omgr
|
static long |
HISTORY_EXPIRATION
The amount of time before chat history becomes... history. |
| Constructor Summary | |
|---|---|
ChatHistory()
Creates a new chat history, automatically registering a message observer with SpeakUtil. |
|
| Method Summary | |
|---|---|
void |
clear(Name username)
Clears the chat history for the specified user. |
List<ChatHistory.Entry> |
get(Name username)
Returns a list of ChatHistory.Entry objects, one for each message to which this user has been
privy in the recent past. |
protected List<ChatHistory.Entry> |
getList(Name username)
Returns this user's chat history, creating one if necessary. |
void |
hold(Name username)
Causes the chat history for the given user to be held briefly after the clear(com.threerings.util.Name)
call so that session observers can grab it. |
protected void |
prune(long now,
List<ChatHistory.Entry> history)
Prunes all messages from this history which are expired. |
void |
record(ChatChannel channel,
UserMessage msg,
Name... usernames)
Records the specified channel and message to the specified users' chat histories. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long HISTORY_EXPIRATION
protected Map<Name,List<ChatHistory.Entry>> _histories
protected Set<Name> _holds
@Inject protected PresentsDObjectMgr _omgr
| Constructor Detail |
|---|
public ChatHistory()
SpeakUtil.
| Method Detail |
|---|
public List<ChatHistory.Entry> get(Name username)
ChatHistory.Entry objects, one for each message to which this user has been
privy in the recent past. If the given name implements KeepNoHistory, null is
returned.
public void clear(Name username)
public void record(ChatChannel channel,
UserMessage msg,
Name... usernames)
ChatMessage.timestamp is not already filled in, it will be.
public void hold(Name username)
clear(com.threerings.util.Name)
call so that session observers can grab it.
protected List<ChatHistory.Entry> getList(Name username)
KeepNoHistory, null is returned.
protected void prune(long now,
List<ChatHistory.Entry> history)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||