mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
Merge pull request #4231 from nextcloud/bugfix/noid/fixToShowAccountsFromOlderServers
fix to show accounts from older servers in switch account dialog
This commit is contained in:
commit
e66dc4d805
@ -170,6 +170,38 @@ public class ChooseAccountDialogFragment extends DialogFragment {
|
||||
|
||||
@Override
|
||||
public void onNext(InvitationsModel invitationsModel) {
|
||||
addAccountToSwitcherList(
|
||||
userId,
|
||||
finalUserEntity,
|
||||
invitationsModel.getInvitations().size()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@io.reactivex.annotations.NonNull Throwable e) {
|
||||
Log.e(TAG, "Failed to fetch invitations", e);
|
||||
addAccountToSwitcherList(
|
||||
userId,
|
||||
finalUserEntity,
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
// no actions atm
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addAccountToSwitcherList(
|
||||
String userId,
|
||||
User finalUserEntity,
|
||||
int actionsRequiredCount
|
||||
) {
|
||||
Participant participant;
|
||||
participant = new Participant();
|
||||
participant.setActorType(Participant.ActorType.USERS);
|
||||
@ -181,28 +213,13 @@ public class ChooseAccountDialogFragment extends DialogFragment {
|
||||
finalUserEntity,
|
||||
null,
|
||||
viewThemeUtils,
|
||||
invitationsModel.getInvitations().size()
|
||||
actionsRequiredCount
|
||||
));
|
||||
adapter.addListener(onSwitchItemClickListener);
|
||||
adapter.addListener(onSwitchItemLongClickListener);
|
||||
adapter.updateDataSet(userItems, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@io.reactivex.annotations.NonNull Throwable e) {
|
||||
Log.e(TAG, "Failed to fetch invitations", e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
// no actions atm
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setupListeners(User user) {
|
||||
// Creating listeners for quick-actions
|
||||
binding.currentAccount.getRoot().setOnClickListener(v -> dismiss());
|
||||
|
Loading…
Reference in New Issue
Block a user