Methods Summary |
---|
public synchronized void | addChatSessionListener(ChatSessionListener listener)Registers a ChatSessionListener with the ChatSessionManager to receive
events related to ChatSession.
if ((listener != null) && !mListeners.contains(listener)) {
mListeners.add(listener);
}
|
public void | closeChatSession(ChatSession session)Closes a ChatSession. This only removes the session from the list; the
protocol implementation should override this if it has special work to
do.
mSessions.remove(session);
|
public synchronized ChatSession | createChatSession(ImEntity participant)Creates a new ChatSession with specified participant.
for(ChatSession session : mSessions) {
if(session.getParticipant().equals(participant)) {
return session;
}
}
ChatSession session = new ChatSession(participant, this);
for (ChatSessionListener listener : mListeners) {
listener.onChatSessionCreated(session);
}
mSessions.add(session);
return session;
|
public synchronized void | removeChatSessionListener(ChatSessionListener listener)Removes a ChatSessionListener so that it will no longer be notified.
mListeners.remove(listener);
|
protected abstract void | sendMessageAsync(ChatSession session, Message message)Sends a message to specified participant(s) asynchronously.
TODO: more docs on async callbacks.
|