public class QBRestChatService extends BaseService
Modifier and Type | Method and Description |
---|---|
static Performer<java.lang.Boolean> |
checkIsDialogNotificationEnabled(java.lang.String dialogId)
Checks if Push Notification enabled for offline messages in dialog.
|
static Performer<QBChatDialog> |
createChatDialog(QBChatDialog dialog)
Creates the chat dialog.
|
static Performer<QBChatMessage> |
createMessage(QBChatMessage message,
boolean sendToDialog)
Create the message
|
static Performer<java.lang.Void> |
deleteDialog(java.lang.String dialogID,
boolean forceDelete)
Delete the dialog.
|
static Performer<java.util.ArrayList<java.lang.String>> |
deleteDialogs(<any> dialogIDs,
boolean forceDelete,
Bundle bundle)
Delete the dialog.
|
static Performer<java.lang.Void> |
deleteMessage(java.lang.String messageId,
boolean forceDelete)
Delete the chat message.
|
static Performer<java.lang.Void> |
deleteMessages(java.util.Set<java.lang.String> messageIDs,
boolean forceDelete)
Delete list of messages.
|
static Performer<QBChatDialog> |
getChatDialogById(java.lang.String dialogId)
Retrieves chat dialog by dialog ID.
|
static Performer<java.util.ArrayList<QBChatDialog>> |
getChatDialogs(QBDialogType type,
QBRequestGetBuilder requestBuilder)
Retrieves chat dialogs associated with the current currentUser.
|
static Performer<java.lang.Integer> |
getChatDialogsCount(QBRequestGetBuilder requestBuilder,
Bundle returnedBundle)
Retrieves amount of chat dialogs.
|
static Performer<java.util.ArrayList<QBChatMessage>> |
getDialogMessages(QBChatDialog dialog,
QBRequestGetBuilder requestBuilder)
Retrieves chat messages associated with a dialog.
|
static Performer<java.lang.Integer> |
getDialogMessagesCount(java.lang.String dialogID)
Retrieves chat messages count associated with a dialog.
|
static Performer<java.lang.Integer> |
getDialogMessagesCount(java.lang.String dialogID,
QBRequestGetBuilder requestGetBuilder)
Retrieves chat messages count associated with a dialog.
|
static Performer<java.lang.Integer> |
getTotalUnreadMessagesCount(java.util.Set<java.lang.String> dialogIDs,
Bundle returnedBundle)
Retrieves total chat messages count.
|
static Performer<java.lang.Void> |
markMessagesAsRead(java.lang.String dialogId,
<any> messageIds)
Mark chat messages as read.
|
static Performer<QBChatDialog> |
updateChatDialog(QBChatDialog dialog,
QBRequestUpdateBuilder requestBuilder)
Updates the chat dialog.
|
static Performer<java.lang.Boolean> |
updateDialogNotificationSending(java.lang.String dialogId,
boolean sendingNotificationEnable)
Disables or Enables Push Notification for offline messages in dialog.
|
static Performer<QBChatDialog> |
updateGroupChatDialog(QBChatDialog dialog,
QBRequestUpdateBuilder requestBuilder)
Deprecated.
since 3.8.0, use
updateChatDialog(QBChatDialog, QBRequestUpdateBuilder) instead of |
static Performer<java.lang.Void> |
updateMessage(java.lang.String messageId,
java.lang.String dialogId,
QBMessageUpdateBuilder messageUpdateBuilder)
Update message.
|
createBaseService, createFromExistentToken, getBaseService, getToken, getTokenExpirationDate, resetCredentials, setToken, setTokenExpirationDate
public static Performer<QBChatDialog> createChatDialog(QBChatDialog dialog)
DialogUtils.buildDialog(String, QBDialogType, List)
For creating new private QBDialog with occupant you can use DialogUtils.buildPrivateDialog(int)
For creating new QBDialog with type according to number of users you can use DialogUtils.buildDialog(QBUser...)
dialog
- The dialog entity to create.public static Performer<QBChatDialog> getChatDialogById(java.lang.String dialogId)
dialogId
- The dialog's ID for gettingQBRequestGetBuilder
public static Performer<java.util.ArrayList<QBChatDialog>> getChatDialogs(QBDialogType type, QBRequestGetBuilder requestBuilder)
type
- The type of a dialog to retrieve. Pass null to retrieve all types.requestBuilder
- The builder to set of additional search parametersQBRequestGetBuilder
public static Performer<java.lang.Integer> getChatDialogsCount(QBRequestGetBuilder requestBuilder, Bundle returnedBundle)
requestBuilder
- The builder to set of additional search parametersreturnedBundle
- The bundle with response additional information.QBRequestGetBuilder
@Deprecated public static Performer<QBChatDialog> updateGroupChatDialog(QBChatDialog dialog, QBRequestUpdateBuilder requestBuilder)
updateChatDialog(QBChatDialog, QBRequestUpdateBuilder)
instead ofQBDialogType.PUBLIC_GROUP
.dialog
- The dialog entity to update.requestBuilder
- The additional update parameters.public static Performer<QBChatDialog> updateChatDialog(QBChatDialog dialog, QBRequestUpdateBuilder requestBuilder)
QBDialogType.PUBLIC_GROUP
.
For QBDialogType.PRIVATE possible for update only custom data field.dialog
- The dialog entity to update.requestBuilder
- The additional update parameters.public static Performer<java.util.ArrayList<java.lang.String>> deleteDialogs(<any> dialogIDs, boolean forceDelete, Bundle bundle)
dialogIDs
- Array list of IDs of dialogs to be removed.forceDelete
- Whether completely remove dialogs.
Only dialog's owner can completely remove the dialog.public static Performer<java.lang.Void> deleteDialog(java.lang.String dialogID, boolean forceDelete)
dialogID
- The dialog ID to delete.forceDelete
- Whether completely remove a dialog.
Only dialog's owner can completely remove the dialog.public static Performer<java.lang.Boolean> updateDialogNotificationSending(java.lang.String dialogId, boolean sendingNotificationEnable)
dialogId
- dialog's id for changing settingssendingNotificationEnable
- true - enables notifications, false - disables notificationspublic static Performer<java.lang.Boolean> checkIsDialogNotificationEnabled(java.lang.String dialogId)
dialogId
- dialog's id for checkpublic static Performer<QBChatMessage> createMessage(QBChatMessage message, boolean sendToDialog)
message
- The message to create.sendToDialog
- Sends a message to chat or just create it.public static Performer<java.util.ArrayList<QBChatMessage>> getDialogMessages(QBChatDialog dialog, QBRequestGetBuilder requestBuilder)
dialog
- The dialog which chat messages history you would like to retrieve.
The QBDialog entity has to contain filled dialogId field.requestBuilder
- The builder to set additional search parametersQBRequestGetBuilder
public static Performer<java.lang.Integer> getDialogMessagesCount(java.lang.String dialogID)
dialogID
- The dialog ID which chat messages you would like to count.public static Performer<java.lang.Integer> getDialogMessagesCount(java.lang.String dialogID, QBRequestGetBuilder requestGetBuilder)
dialogID
- The dialog ID which chat messages you would like to count.requestGetBuilder
- The builder to set additional search parameters.public static Performer<java.lang.Integer> getTotalUnreadMessagesCount(java.util.Set<java.lang.String> dialogIDs, Bundle returnedBundle)
dialogIDs
- Array of dialogs ids to get a count of unread messages for. You also can omit this parameter to receive just a total count of all unread messagespublic static Performer<java.lang.Void> markMessagesAsRead(java.lang.String dialogId, <any> messageIds)
dialogId
- The dialog ID which chat messages you would like to mark as read.messageIds
- The array of messages IDs to mark as read.public static Performer<java.lang.Void> updateMessage(java.lang.String messageId, java.lang.String dialogId, QBMessageUpdateBuilder messageUpdateBuilder)
messageId
- message ID to update.messageUpdateBuilder
- builder to perform updating operations.QBMessageUpdateBuilder
public static Performer<java.lang.Void> deleteMessage(java.lang.String messageId, boolean forceDelete)
messageId
- The message ID to delete.forceDelete
- Flag for completely remove a message by owner. Set true if you want
completely remove your own message.public static Performer<java.lang.Void> deleteMessages(java.util.Set<java.lang.String> messageIDs, boolean forceDelete)
messageIDs
- The set of messages IDs to delete.forceDelete
- Flag for completely remove a messages by owner. Set true if you want
completely remove your own messages.