q-municate-android icon indicating copy to clipboard operation
q-municate-android copied to clipboard

how can i remove those step like send friendrequest of each other?

Open tatveshwebmigrates opened this issue 6 years ago • 13 comments

how can i do like whats app, without being friend to each other, i am already upload addressbook and retrive alluser but how m'i remove add friend and accept friend step, which function to solve this?

tatveshwebmigrates avatar Mar 26 '18 12:03 tatveshwebmigrates

hello anyone there???

tatveshwebmigrates avatar Mar 28 '18 12:03 tatveshwebmigrates

Just have a look at related to https://github.com/QuickBlox/q-municate-android/issues/267

RomanPronin avatar Mar 28 '18 15:03 RomanPronin

i just read this question answer but which property to enable autojoin true like ios. i want to remove those step add and accept friend. i want to direct send message to the registered user. it is possible in quickblox android app or not???

tatveshwebmigrates avatar Apr 05 '18 06:04 tatveshwebmigrates

Firstly, you can set autojoin settings in QBChatService to automatically join loaded or created on server dialogs: In that way you don't need to join chat dialog manually in code. //Set it before login in chat QBChatService.ConfigurationBuilder builder = new QBChatService.ConfigurationBuilder(); builder.setAutojoinEnabled(true); QBChatService.setConfigurationBuilder(builder); Secondly, sure you can send message to the registered user without being friend. You can look at sample-chat.

RomanPronin avatar Apr 05 '18 07:04 RomanPronin

where can i get QBChatService file?

tatveshwebmigrates avatar Apr 05 '18 09:04 tatveshwebmigrates

You can find description of QBChatService class and other useful info in official docs.

RomanPronin avatar Apr 05 '18 16:04 RomanPronin

when i have open privatedialogActivity before i call this code

QBChatService.ConfigurationBuilder builder = new QBChatService.ConfigurationBuilder(); builder.setAutojoinEnabled(true); QBChatService.setConfigurationBuilder(builder);

after that i have open PrivateDialogActivity in this activity i have seen "You have accepted request"
image but i am not able to type any message or audio/video call.

when i was put the code on audio/video call on click put the code there Like

boolean isFriend = DataManager.getInstance().getFriendDataManager().getByUserId(opponentUser.getId()) != null; if (!isFriend && item.getItemId() != android.R.id.home) { ToastUtils.longToast(R.string.dialog_user_is_not_friend); return true; }


i have get opponentUser.getId() this id but i have not find in my user friend list. so how can i add friend bypass accepting friend request like whatsapp. please reply us as soon as possible.

Thanks.

sureapps avatar Apr 16 '18 12:04 sureapps

are you there ? Please reply me fast as soon as possible .

sureapps avatar Apr 17 '18 10:04 sureapps

If you want use Roster for monitoring user status, you should have a look at #267 branch to autoAcceptIncomingRequests() function. If you don't want use Roster at all, then to be able to type any message just replace in your project:

    @Override
    protected void checkMessageSendingPossibility() {
      //  boolean enable = dataManager.getFriendDataManager().existsByUserId(opponentUser.getId()) && isNetworkAvailable();
      boolean enable = isNetworkAvailable();
        checkMessageSendingPossibility(enable);
    }

RomanPronin avatar Apr 17 '18 16:04 RomanPronin

thanks for the replying. chat option is soved out but when i was click on audio or video call so call the method in ConversationCallFragment like

private void displayOpponentAvatar() { QMUser opponent = ((CallActivity) getActivity()).getOpponentAsUserFromDB(opponents.get(0).getId()); if (StartConversationReason.INCOME_CALL_FOR_ACCEPTION.equals(startConversationReason) && !isVideoCall){ avatarAndNameView.setVisibility(View.VISIBLE); ImageLoader.getInstance().displayImage(opponent.getAvatar(), avatarImageview, ImageLoaderUtils.UIL_USER_AVATAR_DISPLAY_OPTIONS); callingToTextView.setText(opponent.getFullName()); // calling_to_set_timer.setText(); } else if (StartConversationReason.OUTCOME_CALL_MADE.equals(startConversationReason)) { avatarAndNameView.setVisibility(View.VISIBLE); ImageLoader.getInstance().displayImage(opponent.getAvatar(), avatarImageview, ImageLoaderUtils.UIL_USER_AVATAR_DISPLAY_OPTIONS); callingToTextView.setText(getString(R.string.calling_to, opponent.getFullName())); // calling_to_set_timer.setText(); } }


so in this method CallActivity.java in calling this function

public QMUser getOpponentAsUserFromDB(int opponentId) { DataManager dataManager = DataManager.getInstance(); Friend friend = dataManager.getFriendDataManager().getByUserId(opponentId); return friend.getUser(); }

return null so my app was crash. so how can i enable this features like same as chat option.

sureapps avatar Apr 18 '18 06:04 sureapps

You can try for example the next, replace code:

QMUser opponent = ((CallActivity) getActivity()).getOpponentAsUserFromDB(opponents.get(0).getId());
//with
QMUser opponent = QMUserService.getInstance().getUserCache().get((long)opponents.get(0).getId());

RomanPronin avatar Apr 18 '18 10:04 RomanPronin

thanks for replying .

IncomingCallFragment.java in this function call so in this function in change any thing. private void setOpponentAvatarAndName(){ QMUser opponent = ((CallActivity) getActivity()).getOpponentAsUserFromDB(sessionDescription.getCallerID()); ImageLoader.getInstance().displayImage(opponent.getAvatar(), avatarImageView, ImageLoaderUtils.UIL_USER_AVATAR_DISPLAY_OPTIONS); callerName.setText(opponent.getFullName()); }

sureapps avatar Apr 18 '18 10:04 sureapps

and also we can implement QBFriendListHelper.java file so that is right or wrong?


private Collection<Integer> createFriendList( Collection<QBRosterEntry> rosterEntryCollection) throws QBResponseException { Collection<Integer> friendList = new ArrayList<>(); Collection<Integer> userList = new ArrayList<>();

    for (QBRosterEntry rosterEntry : rosterEntryCollection) {
        if (!UserFriendUtils.isOutgoingFriend(rosterEntry) && !UserFriendUtils.isNoneFriend(rosterEntry)) {
            friendList.add(rosterEntry.getUserId());
        } else if (UserFriendUtils.isNoneFriend(rosterEntry)){
            //need remove friend from DB which deleted me when I was offline
            friendList.add(rosterEntry.getUserId());
          //  removeFriendLocal(rosterEntry.getUserId());
        }

        if (UserFriendUtils.isOutgoingFriend(rosterEntry)) {
            userList.add(rosterEntry.getUserId());
        }
    }

    loadAndSaveUsers(userList, UserRequest.RequestStatus.OUTGOING);

    return friendList;
}

sureapps avatar Apr 18 '18 10:04 sureapps