public class ChatManager extends Object
Modifier and Type | Method and Description |
---|---|
void |
addMemberInGroup(String chatJid,
String newMemberJid,
GenericCallback callback)
This function add a one user to a specific group chat.
|
protected void |
addUnreadMessagesCount(String jid) |
protected void |
addUnreadMessagesCount(String jid,
long num) |
void |
createNewChat(String jid,
GenericCallback callback)
This function create a new single chat.
|
void |
createNewGroupChat(String name,
String members,
GroupDataCallback callback)
This function create a chat group with the name and members
|
void |
deleteChat(Chat chat)
This function delete a specific chat without callback
|
void |
deleteChat(Chat chat,
GenericCallback callback)
This function delete a specific chat with callback
|
Chat |
getChatByJid(String jid)
This function returns a Chat object that corresponding with jid.
|
Cursor |
getChatsFilterByName(String name)
This function return a cursor with active chats and last message filter by chat name.
|
Cursor |
getChatsWithLastMessages()
This function returns a cursor with active chats and the last message of each chat.
|
Cursor |
getCursorUserIncludeInChat(String chatJid)
This function return a cursor with users participate in a specific chat.
|
int |
getUnreadMessages(String chatJid)
This function get a number of messages unread of specific chat.
|
ArrayList<User> |
getUserIncludeInChat(String chatJid)
This function return a list of users participate in a specific chat.
|
Cursor |
getUserNotIncludeInChat(String chatJid)
This function return a cursor with users that no include in any chat.
|
ArrayList<User> |
getUserNotIncludeInChatList(String chatJid)
This function return a list of users that no include in any chat.
|
void |
leaveGroup(String groupJid,
GenericCallback callback)
This function leaves of the group chat.
|
void |
resetUnreadMessages(String chatJid)
This function resets number of messages unread in specific chat,
also mark all messages to read of this chat.
|
void |
showGroupInfo(String groupJid) |
public void resetUnreadMessages(String chatJid)
chatJid
- the jid of the chat.public int getUnreadMessages(String chatJid)
chatJid
- he jid of the chat.public Chat getChatByJid(String jid)
jid
- the chat jid.public Cursor getChatsWithLastMessages()
public Cursor getChatsFilterByName(String name)
name
- this a filter chat name.public Cursor getUserNotIncludeInChat(String chatJid)
chatJid
- this id of chat.public ArrayList<User> getUserNotIncludeInChatList(String chatJid)
chatJid
- this id of chat.public Cursor getCursorUserIncludeInChat(String chatJid)
chatJid
- this id of chat.public ArrayList<User> getUserIncludeInChat(String chatJid)
chatJid
- this id of chat.protected void addUnreadMessagesCount(String jid)
protected void addUnreadMessagesCount(String jid, long num)
public void createNewChat(String jid, GenericCallback callback)
jid
- the user jid to create a single chat.callback
- use to notify when chat is created.public void deleteChat(Chat chat, GenericCallback callback)
chat
- chat that be deleted.callback
- use to notify when chat is deleted.public void deleteChat(Chat chat)
chat
- chat that be deleted.public void createNewGroupChat(String name, String members, GroupDataCallback callback)
name
- of group chatmembers
- group members (their jids), separated by commacallback
- use to notify when the group chat is created.public void addMemberInGroup(String chatJid, String newMemberJid, GenericCallback callback)
chatJid
- the group chat id.newMemberJid
- the id of new user added.callback
- use to notify when the user is added in group chat.public void showGroupInfo(String groupJid)
public void leaveGroup(String groupJid, GenericCallback callback)
groupJid
- group chat idcallback
- use to notify when you leaved of specific group chat.