public class SwarmMessageThread
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
SwarmMessageThread.GotMessagesCB |
static class |
SwarmMessageThread.GotNumMessages |
static class |
SwarmMessageThread.GotThreadsCB |
static class |
SwarmMessageThread.SentMessageCB |
Modifier and Type | Field and Description |
---|---|
int |
id
The unique identification number.
|
java.lang.String |
lastMessage
The text of the most recent message in the thread.
|
SwarmUser |
otherUser
The other user that is participating in the message thread.
|
boolean |
viewed
True if the most recent message in the thread has been viewed, false otherwise.
|
Constructor and Description |
---|
SwarmMessageThread() |
Modifier and Type | Method and Description |
---|---|
static void |
getAllThreads(SwarmMessageThread.GotThreadsCB cb)
Gets all threads for the user (regardless of whether or not they have been viewed by the user).
|
static void |
getMessages(int threadId,
int otherUserId,
SwarmMessageThread.GotMessagesCB cb)
Gets all messages that were sent by a user (specified by the otherUserId) contained within a SwarmMessageThread (specified by the threadId).
|
static void |
getMessages(int threadId,
SwarmMessageThread.GotMessagesCB cb)
Gets all messages contained within a SwarmMessageThread (specified by the threadId).
|
void |
getMessages(SwarmMessageThread.GotMessagesCB cb)
Gets the messages contained in this SwarmMessageThread.
|
static void |
getNumNewMessages(SwarmMessageThread.GotNumMessages cb)
Gets the number of threads that have not yet been viewed by the user.
|
void |
markRead()
Marks the message thread as read (similar to marking an email in your inbox as read).
|
void |
reply(java.lang.String message,
SwarmMessageThread.SentMessageCB cb)
Send a reply to a message thread.
|
public int id
public boolean viewed
public SwarmUser otherUser
public java.lang.String lastMessage
public void markRead()
public void reply(java.lang.String message, SwarmMessageThread.SentMessageCB cb)
message
- The string contents of the reply.cb
- The SentMessageCallback returns a SendMessageAPI result if the reply was successfully sent, returns in the sendFailed method.
The result contains a result.newThread boolean that is true if a new thread was created due to the reply, false otherwise.
The result contains a result.threadId identification number for the thread that the reply was sent to.public static void getNumNewMessages(SwarmMessageThread.GotNumMessages cb)
cb
- On success, the GotNumMessages callback returns the integer number of
threads that have not been viewed by the user, returns -1 on failure.public static void getAllThreads(SwarmMessageThread.GotThreadsCB cb)
cb
- On success, the GotThreadsCB returns a List of SwarmMessageThreads, returns null on failure.public void getMessages(SwarmMessageThread.GotMessagesCB cb)
cb
- The GotMessagesCB callback for this request.public static void getMessages(int threadId, SwarmMessageThread.GotMessagesCB cb)
threadId
- The threadId of the SwarmMessageThread for this request.cb
- The GotMessagesCB callback for this request.public static void getMessages(int threadId, int otherUserId, SwarmMessageThread.GotMessagesCB cb)
threadId
- The threadId of the SwarmMessageThread for this request.otherUserId
- The otherUserId of the user for this request.cb
- The GotMessagesCB callback for this request.