private void notifyFriendsRoomUpdate(QBDialog dialog, List<Integer> friendIdsList) {
   for (Integer friendId : friendIdsList) {
     try {
       notifyFriendOnUpdateChat(dialog, friendId);
     } catch (QBResponseException responseException) {
       ErrorUtils.logError(responseException);
     } catch (SmackException.NotConnectedException e) {
       ErrorUtils.logError(e);
     } catch (XMPPException e) {
       ErrorUtils.logError(e);
     }
   }
 }
 private void tryJoinRoomChat(QBDialog dialog) {
   try {
     joinRoomChat(dialog);
   } catch (Exception e) {
     ErrorUtils.logError(e);
   }
 }
 private QBGroupChat createChatIfNotExist(QBDialog dialog) throws QBResponseException {
   boolean notNull = Utils.validateNotNull(groupChatManager);
   if (!notNull) {
     ErrorUtils.logError(TAG, " groupChatManager is NULL");
     throw new QBResponseException(context.getString(R.string.dlg_fail_create_chat));
   }
   groupChat = groupChatManager.getGroupChat(dialog.getRoomJid());
   if (groupChat == null) {
     groupChat = groupChatManager.createGroupChat(dialog.getRoomJid());
     groupChat.addMessageListener(roomChatMessageListener);
   }
   return groupChat;
 }
  private boolean subscribeToPushNotifications(String regId) {
    String deviceId = getDeviceIdForMobile(activityRef.get());
    if (deviceId == null) {
      deviceId = getDeviceIdForTablet(activityRef.get());
    }

    ArrayList<QBSubscription> subscriptions = null;
    try {
      subscriptions =
          QBMessages.subscribeToPushNotificationsTask(regId, deviceId, QBEnvironment.PRODUCTION);
    } catch (QBResponseException e) {
      ErrorUtils.logError(e);
    }
    return subscriptions != null;
  }