mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-28 17:38:55 +03:00
fix to show accounts from older servers in switch account dialog
if invitations were not supported, the account did not show up Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
0fe3e849bb
commit
853134176a
1 changed files with 33 additions and 16 deletions
|
@ -170,6 +170,38 @@ public class ChooseAccountDialogFragment extends DialogFragment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(InvitationsModel invitationsModel) {
|
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 participant;
|
||||||
participant = new Participant();
|
participant = new Participant();
|
||||||
participant.setActorType(Participant.ActorType.USERS);
|
participant.setActorType(Participant.ActorType.USERS);
|
||||||
|
@ -181,28 +213,13 @@ public class ChooseAccountDialogFragment extends DialogFragment {
|
||||||
finalUserEntity,
|
finalUserEntity,
|
||||||
null,
|
null,
|
||||||
viewThemeUtils,
|
viewThemeUtils,
|
||||||
invitationsModel.getInvitations().size()
|
actionsRequiredCount
|
||||||
));
|
));
|
||||||
adapter.addListener(onSwitchItemClickListener);
|
adapter.addListener(onSwitchItemClickListener);
|
||||||
adapter.addListener(onSwitchItemLongClickListener);
|
adapter.addListener(onSwitchItemLongClickListener);
|
||||||
adapter.updateDataSet(userItems, false);
|
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) {
|
private void setupListeners(User user) {
|
||||||
// Creating listeners for quick-actions
|
// Creating listeners for quick-actions
|
||||||
binding.currentAccount.getRoot().setOnClickListener(v -> dismiss());
|
binding.currentAccount.getRoot().setOnClickListener(v -> dismiss());
|
||||||
|
|
Loading…
Reference in a new issue