mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
Bug fixes related to guest account
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
74f5616392
commit
c1f9dd2ac5
@ -21,7 +21,6 @@
|
|||||||
package com.nextcloud.talk.api;
|
package com.nextcloud.talk.api;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import com.nextcloud.talk.models.json.call.CallOverall;
|
|
||||||
import com.nextcloud.talk.models.json.capabilities.CapabilitiesOverall;
|
import com.nextcloud.talk.models.json.capabilities.CapabilitiesOverall;
|
||||||
import com.nextcloud.talk.models.json.chat.ChatOverall;
|
import com.nextcloud.talk.models.json.chat.ChatOverall;
|
||||||
import com.nextcloud.talk.models.json.generic.GenericOverall;
|
import com.nextcloud.talk.models.json.generic.GenericOverall;
|
||||||
@ -153,8 +152,7 @@ public interface NcApi {
|
|||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST
|
@POST
|
||||||
Observable<CallOverall> joinRoom(@Nullable @Header("Authorization") String authorization, @Url String url,
|
Observable<RoomOverall> joinRoom(@Nullable @Header("Authorization") String authorization, @Url String url, @Nullable @Field("password") String password);
|
||||||
@Nullable @Field("password") String password);
|
|
||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
Observable<GenericOverall> leaveRoom(@Nullable @Header("Authorization") String authorization, @Url String url);
|
Observable<GenericOverall> leaveRoom(@Nullable @Header("Authorization") String authorization, @Url String url);
|
||||||
|
@ -58,8 +58,8 @@ import com.nextcloud.talk.controllers.base.BaseController;
|
|||||||
import com.nextcloud.talk.events.*;
|
import com.nextcloud.talk.events.*;
|
||||||
import com.nextcloud.talk.models.ExternalSignalingServer;
|
import com.nextcloud.talk.models.ExternalSignalingServer;
|
||||||
import com.nextcloud.talk.models.database.UserEntity;
|
import com.nextcloud.talk.models.database.UserEntity;
|
||||||
import com.nextcloud.talk.models.json.call.CallOverall;
|
|
||||||
import com.nextcloud.talk.models.json.capabilities.CapabilitiesOverall;
|
import com.nextcloud.talk.models.json.capabilities.CapabilitiesOverall;
|
||||||
|
import com.nextcloud.talk.models.json.conversations.RoomOverall;
|
||||||
import com.nextcloud.talk.models.json.generic.GenericOverall;
|
import com.nextcloud.talk.models.json.generic.GenericOverall;
|
||||||
import com.nextcloud.talk.models.json.participants.Participant;
|
import com.nextcloud.talk.models.json.participants.Participant;
|
||||||
import com.nextcloud.talk.models.json.participants.ParticipantsOverall;
|
import com.nextcloud.talk.models.json.participants.ParticipantsOverall;
|
||||||
@ -1026,15 +1026,15 @@ public class CallController extends BaseController {
|
|||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.retry(3)
|
.retry(3)
|
||||||
.subscribe(new Observer<CallOverall>() {
|
.subscribe(new Observer<RoomOverall>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(CallOverall callOverall) {
|
public void onNext(RoomOverall roomOverall) {
|
||||||
callSession = callOverall.getOcs().getData().getSessionId();
|
callSession = roomOverall.getOcs().getData().getSessionId();
|
||||||
ApplicationWideCurrentRoomHolder.getInstance().setSession(callSession);
|
ApplicationWideCurrentRoomHolder.getInstance().setSession(callSession);
|
||||||
ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomId(roomId);
|
ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomId(roomId);
|
||||||
ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomToken(roomToken);
|
ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomToken(roomToken);
|
||||||
|
@ -85,8 +85,6 @@ import com.nextcloud.talk.events.UserMentionClickEvent;
|
|||||||
import com.nextcloud.talk.events.WebSocketCommunicationEvent;
|
import com.nextcloud.talk.events.WebSocketCommunicationEvent;
|
||||||
import com.nextcloud.talk.models.RetrofitBucket;
|
import com.nextcloud.talk.models.RetrofitBucket;
|
||||||
import com.nextcloud.talk.models.database.UserEntity;
|
import com.nextcloud.talk.models.database.UserEntity;
|
||||||
import com.nextcloud.talk.models.json.call.Call;
|
|
||||||
import com.nextcloud.talk.models.json.call.CallOverall;
|
|
||||||
import com.nextcloud.talk.models.json.chat.ChatMessage;
|
import com.nextcloud.talk.models.json.chat.ChatMessage;
|
||||||
import com.nextcloud.talk.models.json.chat.ChatOverall;
|
import com.nextcloud.talk.models.json.chat.ChatOverall;
|
||||||
import com.nextcloud.talk.models.json.conversations.Conversation;
|
import com.nextcloud.talk.models.json.conversations.Conversation;
|
||||||
@ -188,14 +186,12 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
@BindView(R.id.lobby_text_view)
|
@BindView(R.id.lobby_text_view)
|
||||||
TextView conversationLobbyText;
|
TextView conversationLobbyText;
|
||||||
private List<Disposable> disposableList = new ArrayList<>();
|
private List<Disposable> disposableList = new ArrayList<>();
|
||||||
private String conversationName;
|
|
||||||
private String roomToken;
|
private String roomToken;
|
||||||
private UserEntity conversationUser;
|
private UserEntity conversationUser;
|
||||||
private String roomPassword;
|
private String roomPassword;
|
||||||
private String credentials;
|
private String credentials;
|
||||||
private Conversation currentConversation;
|
private Conversation currentConversation;
|
||||||
private Call currentCall;
|
private boolean inConversation = false;
|
||||||
private boolean inChat = false;
|
|
||||||
private boolean historyRead = false;
|
private boolean historyRead = false;
|
||||||
private int globalLastKnownFutureMessageId = -1;
|
private int globalLastKnownFutureMessageId = -1;
|
||||||
private int globalLastKnownPastMessageId = -1;
|
private int globalLastKnownPastMessageId = -1;
|
||||||
@ -223,6 +219,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
private MagicWebSocketInstance magicWebSocketInstance;
|
private MagicWebSocketInstance magicWebSocketInstance;
|
||||||
|
|
||||||
private Handler lobbyTimerHandler;
|
private Handler lobbyTimerHandler;
|
||||||
|
private boolean roomJoined;
|
||||||
|
|
||||||
public ChatController(Bundle args) {
|
public ChatController(Bundle args) {
|
||||||
super(args);
|
super(args);
|
||||||
@ -235,9 +232,6 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
|
|
||||||
if (args.containsKey(BundleKeys.INSTANCE.getKEY_ACTIVE_CONVERSATION())) {
|
if (args.containsKey(BundleKeys.INSTANCE.getKEY_ACTIVE_CONVERSATION())) {
|
||||||
this.currentConversation = Parcels.unwrap(args.getParcelable(BundleKeys.INSTANCE.getKEY_ACTIVE_CONVERSATION()));
|
this.currentConversation = Parcels.unwrap(args.getParcelable(BundleKeys.INSTANCE.getKEY_ACTIVE_CONVERSATION()));
|
||||||
if (currentConversation != null) {
|
|
||||||
conversationName = currentConversation.getDisplayName();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.roomPassword = args.getString(BundleKeys.INSTANCE.getKEY_CONVERSATION_PASSWORD(), "");
|
this.roomPassword = args.getString(BundleKeys.INSTANCE.getKEY_CONVERSATION_PASSWORD(), "");
|
||||||
@ -272,24 +266,16 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(RoomOverall roomOverall) {
|
public void onNext(RoomOverall roomOverall) {
|
||||||
Conversation oldConversation = null;
|
|
||||||
|
|
||||||
if (currentConversation != null) {
|
|
||||||
oldConversation = currentConversation;
|
|
||||||
}
|
|
||||||
|
|
||||||
currentConversation = roomOverall.getOcs().getData();
|
currentConversation = roomOverall.getOcs().getData();
|
||||||
|
|
||||||
loadAvatarForStatusBar();
|
loadAvatarForStatusBar();
|
||||||
|
|
||||||
conversationName = currentConversation.getDisplayName();
|
|
||||||
setTitle();
|
setTitle();
|
||||||
setupMentionAutocomplete();
|
setupMentionAutocomplete();
|
||||||
|
|
||||||
checkReadOnlyState();
|
checkReadOnlyState();
|
||||||
checkLobbyState();
|
checkLobbyState();
|
||||||
|
|
||||||
if (oldConversation == null || oldConversation.getRoomId() == null) {
|
if (!inConversation) {
|
||||||
joinRoomWithPassword();
|
joinRoomWithPassword();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -329,19 +315,11 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
if (roomId.equals(conversation.getRoomId())) {
|
if (roomId.equals(conversation.getRoomId())) {
|
||||||
roomToken = conversation.getToken();
|
roomToken = conversation.getToken();
|
||||||
currentConversation = conversation;
|
currentConversation = conversation;
|
||||||
loadAvatarForStatusBar();
|
|
||||||
checkLobbyState();
|
|
||||||
checkReadOnlyState();
|
|
||||||
conversationName = conversation.getDisplayName();
|
|
||||||
setTitle();
|
setTitle();
|
||||||
|
getRoomInfo();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(roomToken)) {
|
|
||||||
setupMentionAutocomplete();
|
|
||||||
joinRoomWithPassword();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -531,17 +509,15 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
if (currentConversation != null && currentConversation.getRoomId() != null) {
|
if (currentConversation != null && currentConversation.getRoomId() != null) {
|
||||||
loadAvatarForStatusBar();
|
loadAvatarForStatusBar();
|
||||||
checkLobbyState();
|
checkLobbyState();
|
||||||
|
setTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (adapterWasNull) {
|
if (adapterWasNull) {
|
||||||
// we're starting
|
// we're starting
|
||||||
if (TextUtils.isEmpty(roomToken)) {
|
if (TextUtils.isEmpty(roomToken)) {
|
||||||
handleFromNotification();
|
handleFromNotification();
|
||||||
} else if (TextUtils.isEmpty(conversationName)) {
|
|
||||||
getRoomInfo();
|
|
||||||
} else {
|
} else {
|
||||||
setupMentionAutocomplete();
|
getRoomInfo();
|
||||||
joinRoomWithPassword();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -696,9 +672,9 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
|
|
||||||
cancelNotificationsForCurrentConversation();
|
cancelNotificationsForCurrentConversation();
|
||||||
|
|
||||||
if (inChat) {
|
if (inConversation) {
|
||||||
if (wasDetached && conversationUser.hasSpreedFeatureCapability("no-ping")) {
|
if (wasDetached && conversationUser.hasSpreedFeatureCapability("no-ping")) {
|
||||||
currentCall = null;
|
currentConversation.setSessionId("0");
|
||||||
wasDetached = false;
|
wasDetached = false;
|
||||||
joinRoomWithPassword();
|
joinRoomWithPassword();
|
||||||
}
|
}
|
||||||
@ -736,7 +712,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTitle() {
|
protected String getTitle() {
|
||||||
return String.valueOf(EmojiCompat.get().process(conversationName));
|
return String.valueOf(EmojiCompat.get().process(currentConversation.getDisplayName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -752,7 +728,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
}
|
}
|
||||||
|
|
||||||
adapter = null;
|
adapter = null;
|
||||||
inChat = false;
|
inConversation = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dispose() {
|
private void dispose() {
|
||||||
@ -770,8 +746,8 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.repeatWhen(observable -> observable.delay(5000, TimeUnit.MILLISECONDS))
|
.repeatWhen(observable -> observable.delay(5000, TimeUnit.MILLISECONDS))
|
||||||
.takeWhile(observable -> inChat)
|
.takeWhile(observable -> inConversation)
|
||||||
.retry(3, observable -> inChat)
|
.retry(3, observable -> inConversation)
|
||||||
.subscribe(new Observer<GenericOverall>() {
|
.subscribe(new Observer<GenericOverall>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
@ -801,23 +777,24 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
|
|
||||||
private void joinRoomWithPassword() {
|
private void joinRoomWithPassword() {
|
||||||
|
|
||||||
if (currentCall == null) {
|
if (currentConversation == null || TextUtils.isEmpty(currentConversation.getSessionId()) || currentConversation.getSessionId().equals("0")) {
|
||||||
ncApi.joinRoom(credentials,
|
ncApi.joinRoom(credentials,
|
||||||
ApiUtils.getUrlForSettingMyselfAsActiveParticipant(conversationUser.getBaseUrl(), roomToken), roomPassword)
|
ApiUtils.getUrlForSettingMyselfAsActiveParticipant(conversationUser.getBaseUrl(), roomToken), roomPassword)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.retry(3)
|
.retry(3)
|
||||||
.subscribe(new Observer<CallOverall>() {
|
.subscribe(new Observer<RoomOverall>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
disposableList.add(d);
|
disposableList.add(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(CallOverall callOverall) {
|
public void onNext(RoomOverall roomOverall) {
|
||||||
inChat = true;
|
inConversation = true;
|
||||||
currentCall = callOverall.getOcs().getData();
|
currentConversation = roomOverall.getOcs().getData();
|
||||||
ApplicationWideCurrentRoomHolder.getInstance().setSession(currentCall.getSessionId());
|
setTitle();
|
||||||
|
ApplicationWideCurrentRoomHolder.getInstance().setSession(currentConversation.getSessionId());
|
||||||
startPing();
|
startPing();
|
||||||
|
|
||||||
setupWebsocket();
|
setupWebsocket();
|
||||||
@ -830,8 +807,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (magicWebSocketInstance != null) {
|
if (magicWebSocketInstance != null) {
|
||||||
magicWebSocketInstance.joinRoomWithRoomTokenAndSession(roomToken,
|
magicWebSocketInstance.joinRoomWithRoomTokenAndSession(roomToken, currentConversation.getSessionId());
|
||||||
currentCall.getSessionId());
|
|
||||||
}
|
}
|
||||||
if (startCallFromNotification != null && startCallFromNotification) {
|
if (startCallFromNotification != null && startCallFromNotification) {
|
||||||
startCallFromNotification = false;
|
startCallFromNotification = false;
|
||||||
@ -850,11 +826,11 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
inChat = true;
|
inConversation = true;
|
||||||
ApplicationWideCurrentRoomHolder.getInstance().setSession(currentCall.getSessionId());
|
ApplicationWideCurrentRoomHolder.getInstance().setSession(currentConversation.getSessionId());
|
||||||
if (magicWebSocketInstance != null) {
|
if (magicWebSocketInstance != null) {
|
||||||
magicWebSocketInstance.joinRoomWithRoomTokenAndSession(roomToken,
|
magicWebSocketInstance.joinRoomWithRoomTokenAndSession(roomToken,
|
||||||
currentCall.getSessionId());
|
currentConversation.getSessionId());
|
||||||
}
|
}
|
||||||
startPing();
|
startPing();
|
||||||
if (isFirstMessagesProcessing) {
|
if (isFirstMessagesProcessing) {
|
||||||
@ -885,8 +861,8 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
lobbyTimerHandler.removeCallbacksAndMessages(null);
|
lobbyTimerHandler.removeCallbacksAndMessages(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (magicWebSocketInstance != null && currentCall != null) {
|
if (magicWebSocketInstance != null && currentConversation != null) {
|
||||||
magicWebSocketInstance.joinRoomWithRoomTokenAndSession("", currentCall.getSessionId());
|
magicWebSocketInstance.joinRoomWithRoomTokenAndSession("", currentConversation.getSessionId());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isDestroyed() && !isBeingDestroyed() && !wasDetached) {
|
if (!isDestroyed() && !isBeingDestroyed() && !wasDetached) {
|
||||||
@ -992,7 +968,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void pullChatMessages(int lookIntoFuture) {
|
private void pullChatMessages(int lookIntoFuture) {
|
||||||
if (!inChat) {
|
if (!inConversation) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1031,7 +1007,6 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
|
|
||||||
fieldMap.put("lastKnownMessageId", lastKnown);
|
fieldMap.put("lastKnownMessageId", lastKnown);
|
||||||
|
|
||||||
Log.d("MARIO-PUSH", lastKnown + " " + lookIntoFuture);
|
|
||||||
if (!wasDetached) {
|
if (!wasDetached) {
|
||||||
if (lookIntoFuture > 0) {
|
if (lookIntoFuture > 0) {
|
||||||
int finalTimeout = timeout;
|
int finalTimeout = timeout;
|
||||||
@ -1040,7 +1015,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
fieldMap)
|
fieldMap)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.takeWhile(observable -> inChat && !wasDetached)
|
.takeWhile(observable -> inConversation && !wasDetached)
|
||||||
.subscribe(new Observer<Response>() {
|
.subscribe(new Observer<Response>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
@ -1068,8 +1043,8 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
ApiUtils.getUrlForChat(conversationUser.getBaseUrl(), roomToken), fieldMap)
|
ApiUtils.getUrlForChat(conversationUser.getBaseUrl(), roomToken), fieldMap)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.retry(3, observable -> inChat && !wasDetached)
|
.retry(3, observable -> inConversation && !wasDetached)
|
||||||
.takeWhile(observable -> inChat && !wasDetached)
|
.takeWhile(observable -> inConversation && !wasDetached)
|
||||||
.subscribe(new Observer<Response>() {
|
.subscribe(new Observer<Response>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
@ -1222,7 +1197,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inChat) {
|
if (inConversation) {
|
||||||
pullChatMessages(1);
|
pullChatMessages(1);
|
||||||
}
|
}
|
||||||
} else if (response.code() == 304 && !isFromTheFuture) {
|
} else if (response.code() == 304 && !isFromTheFuture) {
|
||||||
@ -1237,7 +1212,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
|
|
||||||
historyRead = true;
|
historyRead = true;
|
||||||
|
|
||||||
if (!lookingIntoFuture && inChat) {
|
if (!lookingIntoFuture && inConversation) {
|
||||||
pullChatMessages(1);
|
pullChatMessages(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1245,7 +1220,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoadMore(int page, int totalItemsCount) {
|
public void onLoadMore(int page, int totalItemsCount) {
|
||||||
if (!historyRead && inChat) {
|
if (!historyRead && inConversation) {
|
||||||
pullChatMessages(0);
|
pullChatMessages(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,10 +35,10 @@ import android.widget.Button;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import autodagger.AutoInjector;
|
|
||||||
import butterknife.BindView;
|
|
||||||
import com.bluelinelabs.conductor.RouterTransaction;
|
import com.bluelinelabs.conductor.RouterTransaction;
|
||||||
import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
|
import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
|
||||||
import com.bluelinelabs.logansquare.LoganSquare;
|
import com.bluelinelabs.logansquare.LoganSquare;
|
||||||
@ -50,32 +50,35 @@ import com.nextcloud.talk.controllers.base.BaseController;
|
|||||||
import com.nextcloud.talk.events.BottomSheetLockEvent;
|
import com.nextcloud.talk.events.BottomSheetLockEvent;
|
||||||
import com.nextcloud.talk.models.RetrofitBucket;
|
import com.nextcloud.talk.models.RetrofitBucket;
|
||||||
import com.nextcloud.talk.models.database.UserEntity;
|
import com.nextcloud.talk.models.database.UserEntity;
|
||||||
import com.nextcloud.talk.models.json.call.Call;
|
|
||||||
import com.nextcloud.talk.models.json.call.CallOverall;
|
|
||||||
import com.nextcloud.talk.models.json.capabilities.Capabilities;
|
import com.nextcloud.talk.models.json.capabilities.Capabilities;
|
||||||
import com.nextcloud.talk.models.json.capabilities.CapabilitiesOverall;
|
import com.nextcloud.talk.models.json.capabilities.CapabilitiesOverall;
|
||||||
import com.nextcloud.talk.models.json.generic.GenericOverall;
|
|
||||||
import com.nextcloud.talk.models.json.participants.AddParticipantOverall;
|
|
||||||
import com.nextcloud.talk.models.json.conversations.Conversation;
|
import com.nextcloud.talk.models.json.conversations.Conversation;
|
||||||
import com.nextcloud.talk.models.json.conversations.RoomOverall;
|
import com.nextcloud.talk.models.json.conversations.RoomOverall;
|
||||||
|
import com.nextcloud.talk.models.json.generic.GenericOverall;
|
||||||
|
import com.nextcloud.talk.models.json.participants.AddParticipantOverall;
|
||||||
import com.nextcloud.talk.utils.ApiUtils;
|
import com.nextcloud.talk.utils.ApiUtils;
|
||||||
import com.nextcloud.talk.utils.ConductorRemapping;
|
import com.nextcloud.talk.utils.ConductorRemapping;
|
||||||
import com.nextcloud.talk.utils.DisplayUtils;
|
import com.nextcloud.talk.utils.DisplayUtils;
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
||||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||||
import com.nextcloud.talk.utils.singletons.ApplicationWideMessageHolder;
|
import com.nextcloud.talk.utils.singletons.ApplicationWideMessageHolder;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
import org.parceler.Parcels;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import autodagger.AutoInjector;
|
||||||
|
import butterknife.BindView;
|
||||||
import io.reactivex.Observer;
|
import io.reactivex.Observer;
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
import io.reactivex.disposables.Disposable;
|
import io.reactivex.disposables.Disposable;
|
||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
import org.greenrobot.eventbus.EventBus;
|
|
||||||
import org.parceler.Parcels;
|
|
||||||
import retrofit2.HttpException;
|
import retrofit2.HttpException;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
@AutoInjector(NextcloudTalkApplication.class)
|
@AutoInjector(NextcloudTalkApplication.class)
|
||||||
public class OperationsMenuController extends BaseController {
|
public class OperationsMenuController extends BaseController {
|
||||||
|
|
||||||
@ -111,7 +114,6 @@ public class OperationsMenuController extends BaseController {
|
|||||||
private String callUrl;
|
private String callUrl;
|
||||||
|
|
||||||
private String baseUrl;
|
private String baseUrl;
|
||||||
private Call call;
|
|
||||||
private String conversationToken;
|
private String conversationToken;
|
||||||
|
|
||||||
private Disposable disposable;
|
private Disposable disposable;
|
||||||
@ -679,7 +681,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
if (baseUrl != null && !baseUrl.equals(currentUser.getBaseUrl())) {
|
if (baseUrl != null && !baseUrl.equals(currentUser.getBaseUrl())) {
|
||||||
bundle.putString(BundleKeys.INSTANCE.getKEY_MODIFIED_BASE_URL(), baseUrl);
|
bundle.putString(BundleKeys.INSTANCE.getKEY_MODIFIED_BASE_URL(), baseUrl);
|
||||||
}
|
}
|
||||||
bundle.putParcelable(BundleKeys.INSTANCE.getKEY_ACTIVE_CONVERSATION(), Parcels.wrap(call));
|
bundle.putParcelable(BundleKeys.INSTANCE.getKEY_ACTIVE_CONVERSATION(), Parcels.wrap(conversation));
|
||||||
|
|
||||||
if (getActivity() != null) {
|
if (getActivity() != null) {
|
||||||
|
|
||||||
@ -710,8 +712,8 @@ public class OperationsMenuController extends BaseController {
|
|||||||
if (operationCode != 99) {
|
if (operationCode != 99) {
|
||||||
showResultImage(true, false);
|
showResultImage(true, false);
|
||||||
} else {
|
} else {
|
||||||
CallOverall callOverall = (CallOverall) o;
|
RoomOverall roomOverall = (RoomOverall) o;
|
||||||
call = callOverall.getOcs().getData();
|
conversation = roomOverall.getOcs().getData();
|
||||||
initiateConversation(true, serverCapabilities);
|
initiateConversation(true, serverCapabilities);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* Nextcloud Talk application
|
|
||||||
*
|
|
||||||
* @author Mario Danic
|
|
||||||
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package com.nextcloud.talk.models.json.call;
|
|
||||||
|
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonField;
|
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
|
||||||
import lombok.Data;
|
|
||||||
import org.parceler.Parcel;
|
|
||||||
|
|
||||||
@Parcel
|
|
||||||
@Data
|
|
||||||
@JsonObject
|
|
||||||
public class Call {
|
|
||||||
@JsonField(name = "sessionId")
|
|
||||||
String sessionId;
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* Nextcloud Talk application
|
|
||||||
*
|
|
||||||
* @author Mario Danic
|
|
||||||
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package com.nextcloud.talk.models.json.call;
|
|
||||||
|
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonField;
|
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
|
||||||
import com.nextcloud.talk.models.json.generic.GenericOCS;
|
|
||||||
import lombok.Data;
|
|
||||||
import org.parceler.Parcel;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Parcel
|
|
||||||
@JsonObject
|
|
||||||
public class CallOCS extends GenericOCS {
|
|
||||||
@JsonField(name = "data")
|
|
||||||
Call data;
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* Nextcloud Talk application
|
|
||||||
*
|
|
||||||
* @author Mario Danic
|
|
||||||
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package com.nextcloud.talk.models.json.call;
|
|
||||||
|
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonField;
|
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
|
||||||
import lombok.Data;
|
|
||||||
import org.parceler.Parcel;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Parcel
|
|
||||||
@JsonObject
|
|
||||||
public class CallOverall {
|
|
||||||
@JsonField(name = "ocs")
|
|
||||||
CallOCS ocs;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user