Only notify for unauthorized response to messages endpoint.

This commit is contained in:
Nicholas
2023-01-04 11:32:43 -05:00
committed by Greyson Parrelli
parent 0fd8f73cca
commit d70fe8f2cd
4 changed files with 11 additions and 31 deletions

View File

@@ -1,22 +0,0 @@
package org.thoughtcrime.securesms.net
import android.content.Context
import okhttp3.Interceptor
import okhttp3.Response
import org.signal.core.util.logging.Log
import org.thoughtcrime.securesms.util.TextSecurePreferences
class UnregisteredInterceptor(val context: Context) : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
val response = chain.proceed(chain.request())
if (response.code() == 403) {
TextSecurePreferences.setUnauthorizedReceived(context, true)
}
return response
}
companion object {
val TAG = Log.tag(UnregisteredInterceptor::class.java)
}
}