瀏覽代碼

avoid error when declining recording consent

When declining recording consent, 404 might be returned when leaving the call (because the call was not joined before).
It might not be the best option to handle this via onError, but for the moment (18.0.0 release) it's the most robust/lowest-risk solution without to change some state handling to check if the call was joined).
finish was added which makes sense anyway, but for declining recording consent the error snackbar was removed.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Marcel Hibbe 1 年之前
父節點
當前提交
6ac9fa5fff
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      app/src/main/java/com/nextcloud/talk/activities/CallActivity.kt

+ 3 - 3
app/src/main/java/com/nextcloud/talk/activities/CallActivity.kt

@@ -2049,7 +2049,7 @@ class CallActivity : CallBaseActivity() {
                 }
 
                 override fun onNext(genericOverall: GenericOverall) {
-                    if (!switchToRoomToken.isEmpty()) {
+                    if (switchToRoomToken.isNotEmpty()) {
                         val intent = Intent(context, ChatActivity::class.java)
                         intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
                         val bundle = Bundle()
@@ -2070,8 +2070,8 @@ class CallActivity : CallBaseActivity() {
                 }
 
                 override fun onError(e: Throwable) {
-                    Snackbar.make(binding!!.root, R.string.nc_common_error_sorry, Snackbar.LENGTH_LONG).show()
-                    Log.e(TAG, "Error while leaving the call", e)
+                    Log.w(TAG, "Something went wrong when leaving the call", e)
+                    finish()
                 }
 
                 override fun onComplete() {