Skip to content

Commit

Permalink
Merge pull request #320 from QuickBlox/development
Browse files Browse the repository at this point in the history
- prepare for release;
  • Loading branch information
tatanka987 authored Oct 27, 2016
2 parents 7b4c12c + f909ce7 commit 9a04640
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 44 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ext {
lintAbortOnError = false

// QuickBlox SDK version
qbSdkVersion = '3.0'
qbSdkVersion = '3.1.0'

versionName = "3.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,37 +105,22 @@ public void onSystemMessageReceived(QBChatMessage systemMessage){
}
}

private void notifyListenersDialogCreated(final QBChatDialog chatDialog){
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
for (ManagingDialogsCallbacks listener : getManagingDialogsCallbackListeners()){
listener.onDialogCreated(chatDialog);
}
}
});
private void notifyListenersDialogCreated(final QBChatDialog chatDialog) {
for (ManagingDialogsCallbacks listener : getManagingDialogsCallbackListeners()) {
listener.onDialogCreated(chatDialog);
}
}

private void notifyListenersDialogUpdated(final String dialogId){
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
for (ManagingDialogsCallbacks listener : getManagingDialogsCallbackListeners()){
listener.onDialogUpdated(dialogId);
}
}
});
private void notifyListenersDialogUpdated(final String dialogId) {
for (ManagingDialogsCallbacks listener : getManagingDialogsCallbackListeners()) {
listener.onDialogUpdated(dialogId);
}
}

private void notifyListenersNewDialogLoaded(final QBChatDialog chatDialog){
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
for (ManagingDialogsCallbacks listener : getManagingDialogsCallbackListeners()){
listener.onNewDialogLoaded(chatDialog);
}
}
});
private void notifyListenersNewDialogLoaded(final QBChatDialog chatDialog) {
for (ManagingDialogsCallbacks listener : getManagingDialogsCallbackListeners()) {
listener.onNewDialogLoaded(chatDialog);
}
}

public void addManagingDialogsCallbackListener(ManagingDialogsCallbacks listener){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,15 @@ public View getView(int position, View convertView, ViewGroup parent) {
private boolean isLastMessageAttachment(QBChatDialog dialog) {
String lastMessage = dialog.getLastMessage();
Integer lastMessageSenderId = dialog.getLastMessageUserId();
return (StringUtils.textIsNull(lastMessage) || TextUtils.isEmpty(lastMessage)) && lastMessageSenderId != null;
return TextUtils.isEmpty(lastMessage) && lastMessageSenderId != null;
}

private String prepareTextLastMessage(QBChatDialog chatDialog){
if (isLastMessageAttachment(chatDialog)){
return context.getString(R.string.chat_attachment);
} else if (!TextUtils.isEmpty(chatDialog.getLastMessage())){
return StringUtils.textIsNull(chatDialog.getLastMessage()) ? EMPTY_STRING : chatDialog.getLastMessage();
} else {
return chatDialog.getLastMessage();
}

return EMPTY_STRING;
}

private static class ViewHolder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,7 @@ public void join(QBChatDialog chatDialog, final QBEntityCallback<Void> callback)
DiscussionHistory history = new DiscussionHistory();
history.setMaxStanzas(0);

chatDialog.join(history, new QbEntityCallbackWrapper<Void>(callback) {
@Override
public void onSuccess(final Void result, final Bundle b) {
onSuccessInMainThread(result, b);
}

@Override
public void onError(final QBResponseException e) {
onErrorInMainThread(e);
}
});
chatDialog.join(history, callback);
}

public void leaveChatDialog(QBChatDialog chatDialog) throws XMPPException, SmackException.NotConnectedException {
Expand Down

0 comments on commit 9a04640

Please sign in to comment.