mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
Fix #337 and closing websocket connections
This commit is contained in:
parent
269b879ee4
commit
e5532a5842
BIN
app/assets/fonts/Nunito-Black.ttf
Normal file
BIN
app/assets/fonts/Nunito-Black.ttf
Normal file
Binary file not shown.
BIN
app/assets/fonts/Nunito-BlackItalic.ttf
Normal file
BIN
app/assets/fonts/Nunito-BlackItalic.ttf
Normal file
Binary file not shown.
BIN
app/assets/fonts/Nunito-Bold.ttf
Normal file
BIN
app/assets/fonts/Nunito-Bold.ttf
Normal file
Binary file not shown.
BIN
app/assets/fonts/Nunito-BoldItalic.ttf
Normal file
BIN
app/assets/fonts/Nunito-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
app/assets/fonts/Nunito-ExtraBold.ttf
Normal file
BIN
app/assets/fonts/Nunito-ExtraBold.ttf
Normal file
Binary file not shown.
BIN
app/assets/fonts/Nunito-ExtraBoldItalic.ttf
Normal file
BIN
app/assets/fonts/Nunito-ExtraBoldItalic.ttf
Normal file
Binary file not shown.
BIN
app/assets/fonts/Nunito-ExtraLight.ttf
Normal file
BIN
app/assets/fonts/Nunito-ExtraLight.ttf
Normal file
Binary file not shown.
BIN
app/assets/fonts/Nunito-ExtraLightItalic.ttf
Normal file
BIN
app/assets/fonts/Nunito-ExtraLightItalic.ttf
Normal file
Binary file not shown.
BIN
app/assets/fonts/Nunito-Italic.ttf
Normal file
BIN
app/assets/fonts/Nunito-Italic.ttf
Normal file
Binary file not shown.
BIN
app/assets/fonts/Nunito-Light.ttf
Normal file
BIN
app/assets/fonts/Nunito-Light.ttf
Normal file
Binary file not shown.
BIN
app/assets/fonts/Nunito-LightItalic.ttf
Normal file
BIN
app/assets/fonts/Nunito-LightItalic.ttf
Normal file
Binary file not shown.
BIN
app/assets/fonts/Nunito-Regular.ttf
Normal file
BIN
app/assets/fonts/Nunito-Regular.ttf
Normal file
Binary file not shown.
BIN
app/assets/fonts/Nunito-SemiBold.ttf
Normal file
BIN
app/assets/fonts/Nunito-SemiBold.ttf
Normal file
Binary file not shown.
BIN
app/assets/fonts/Nunito-SemiBoldItalic.ttf
Normal file
BIN
app/assets/fonts/Nunito-SemiBoldItalic.ttf
Normal file
Binary file not shown.
BIN
app/assets/fonts/NunitoHeavy-Italic.ttf
Normal file
BIN
app/assets/fonts/NunitoHeavy-Italic.ttf
Normal file
Binary file not shown.
BIN
app/assets/fonts/NunitoHeavy-Regular.ttf
Normal file
BIN
app/assets/fonts/NunitoHeavy-Regular.ttf
Normal file
Binary file not shown.
@ -190,6 +190,8 @@ dependencies {
|
||||
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
|
||||
implementation 'com.kevalpatel2106:emoticongifkeyboard:1.1'
|
||||
|
||||
compile 'uk.co.chrisjenx:calligraphy:2.3.0'
|
||||
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation ('androidx.test.espresso:espresso-core:3.1.0-alpha4', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
|
@ -21,6 +21,7 @@
|
||||
package com.nextcloud.talk.activities;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.webkit.SslErrorHandler;
|
||||
@ -45,6 +46,7 @@ import javax.inject.Inject;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import autodagger.AutoInjector;
|
||||
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper;
|
||||
|
||||
@AutoInjector(NextcloudTalkApplication.class)
|
||||
public class BaseActivity extends AppCompatActivity {
|
||||
@ -59,6 +61,11 @@ public class BaseActivity extends AppCompatActivity {
|
||||
NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context newBase) {
|
||||
super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase));
|
||||
}
|
||||
|
||||
public void showCertificateDialog(X509Certificate cert, MagicTrustManager magicTrustManager,
|
||||
@Nullable SslErrorHandler sslErrorHandler) {
|
||||
DateFormat formatter = DateFormat.getDateInstance(DateFormat.LONG);
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
package com.nextcloud.talk.activities;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
@ -45,6 +46,7 @@ import javax.inject.Inject;
|
||||
import autodagger.AutoInjector;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper;
|
||||
|
||||
@AutoInjector(NextcloudTalkApplication.class)
|
||||
public class MagicCallActivity extends BaseActivity {
|
||||
@ -64,6 +66,11 @@ public class MagicCallActivity extends BaseActivity {
|
||||
return flags;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context newBase) {
|
||||
super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -55,6 +55,7 @@ import androidx.work.PeriodicWorkRequest;
|
||||
import androidx.work.WorkManager;
|
||||
import autodagger.AutoComponent;
|
||||
import autodagger.AutoInjector;
|
||||
import uk.co.chrisjenx.calligraphy.CalligraphyConfig;
|
||||
|
||||
@AutoComponent(
|
||||
modules = {
|
||||
@ -109,6 +110,11 @@ public class NextcloudTalkApplication extends MultiDexApplication implements Lif
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
|
||||
.setDefaultFontPath("fonts/Nunito-Regular.ttf")
|
||||
.build()
|
||||
);
|
||||
|
||||
sharedApplication = this;
|
||||
|
||||
initializeWebRtc();
|
||||
|
@ -36,7 +36,6 @@ import com.nextcloud.talk.models.json.websocket.EventOverallWebSocketMessage;
|
||||
import com.nextcloud.talk.models.json.websocket.HelloResponseOverallWebSocketMessage;
|
||||
import com.nextcloud.talk.models.json.websocket.JoinedRoomOverallWebSocketMessage;
|
||||
import com.nextcloud.talk.utils.MagicMap;
|
||||
import com.nextcloud.talk.utils.singletons.ApplicationWideCurrentRoomHolder;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@ -93,7 +92,6 @@ public class MagicWebSocketInstance extends WebSocketListener {
|
||||
|
||||
@Override
|
||||
public void onOpen(WebSocket webSocket, Response response) {
|
||||
if (isConnected()) {
|
||||
try {
|
||||
if (TextUtils.isEmpty(resumeId)) {
|
||||
webSocket.send(LoganSquare.serialize(webSocketConnectionHelper.getAssembledHelloModel(conversationUser, webSocketTicket)));
|
||||
@ -104,7 +102,6 @@ public class MagicWebSocketInstance extends WebSocketListener {
|
||||
Log.e(TAG, "Failed to serialize hello model");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void restartWebSocket() {
|
||||
Request request = new Request.Builder().url(connectionUrl).build();
|
||||
@ -280,7 +277,7 @@ public class MagicWebSocketInstance extends WebSocketListener {
|
||||
ByeWebSocketMessage byeWebSocketMessage = new ByeWebSocketMessage();
|
||||
byeWebSocketMessage.setType("bye");
|
||||
byeWebSocketMessage.setBye(new HashMap<>());
|
||||
webSocket.send(LoganSquare.serialize(byeWebSocketMessage);
|
||||
webSocket.send(LoganSquare.serialize(byeWebSocketMessage));
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, "Failed to serialize bye message");
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ public class WebSocketConnectionHelper {
|
||||
}
|
||||
|
||||
MagicWebSocketInstance magicWebSocketInstance;
|
||||
if ((magicWebSocketInstance = magicWebSocketInstanceMap.get(userEntity.getId())) != null && !magicWebSocketInstance.isPermanentlyClosed()) {
|
||||
if (magicWebSocketInstanceMap.containsKey(userEntity.getId()) && (magicWebSocketInstance = magicWebSocketInstanceMap.get(userEntity.getId())) != null && !magicWebSocketInstance.isPermanentlyClosed()) {
|
||||
return magicWebSocketInstance;
|
||||
} else {
|
||||
magicWebSocketInstance = new MagicWebSocketInstance(userEntity, generatedURL, webSocketTicket);
|
||||
|
Loading…
Reference in New Issue
Block a user