mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-25 19:46:58 +02:00
Follows UserAgent version syntax: User-Agent: <product> / <product-version> <comment>
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
package com.vitorpamplona.amethyst.service
|
package com.vitorpamplona.amethyst.service
|
||||||
|
|
||||||
import com.vitorpamplona.amethyst.BuildConfig
|
|
||||||
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
||||||
|
import com.vitorpamplona.amethyst.BuildConfig
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
@@ -44,7 +44,7 @@ class Nip05Verifier {
|
|||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
try {
|
try {
|
||||||
val request = Request.Builder()
|
val request = Request.Builder()
|
||||||
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
|
.header("User-Agent", "Amethyst/${BuildConfig.VERSION_NAME}")
|
||||||
.url(url)
|
.url(url)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
package com.vitorpamplona.amethyst.service.lnurl
|
package com.vitorpamplona.amethyst.service.lnurl
|
||||||
|
|
||||||
import com.vitorpamplona.amethyst.BuildConfig
|
|
||||||
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
||||||
|
import com.vitorpamplona.amethyst.BuildConfig
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
@@ -53,7 +53,7 @@ class LightningAddressResolver {
|
|||||||
|
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
val request: Request = Request.Builder()
|
val request: Request = Request.Builder()
|
||||||
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
|
.header("User-Agent", "Amethyst/${BuildConfig.VERSION_NAME}")
|
||||||
.url(url)
|
.url(url)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ class LightningAddressResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val request: Request = Request.Builder()
|
val request: Request = Request.Builder()
|
||||||
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
|
.header("User-Agent", "Amethyst/${BuildConfig.VERSION_NAME}")
|
||||||
.url(url)
|
.url(url)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
package com.vitorpamplona.amethyst.service.relays
|
package com.vitorpamplona.amethyst.service.relays
|
||||||
|
|
||||||
import com.vitorpamplona.amethyst.BuildConfig
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import com.google.gson.JsonElement
|
import com.google.gson.JsonElement
|
||||||
|
import com.vitorpamplona.amethyst.BuildConfig
|
||||||
import com.vitorpamplona.amethyst.service.model.Event
|
import com.vitorpamplona.amethyst.service.model.Event
|
||||||
import com.vitorpamplona.amethyst.service.model.EventInterface
|
import com.vitorpamplona.amethyst.service.model.EventInterface
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
@@ -57,7 +57,7 @@ class Relay(
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
val request = Request.Builder()
|
val request = Request.Builder()
|
||||||
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
|
.header("User-Agent", "Amethyst/${BuildConfig.VERSION_NAME}")
|
||||||
.url(url.trim())
|
.url(url.trim())
|
||||||
.build()
|
.build()
|
||||||
val listener = object : WebSocketListener() {
|
val listener = object : WebSocketListener() {
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package com.vitorpamplona.amethyst.ui.actions
|
package com.vitorpamplona.amethyst.ui.actions
|
||||||
|
|
||||||
import com.vitorpamplona.amethyst.BuildConfig
|
|
||||||
import android.content.ContentResolver
|
import android.content.ContentResolver
|
||||||
import android.content.ContentValues
|
import android.content.ContentValues
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
@@ -9,6 +8,7 @@ import android.os.Build
|
|||||||
import android.os.Environment
|
import android.os.Environment
|
||||||
import android.provider.MediaStore
|
import android.provider.MediaStore
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
|
import com.vitorpamplona.amethyst.BuildConfig
|
||||||
import okhttp3.*
|
import okhttp3.*
|
||||||
import okio.BufferedSource
|
import okio.BufferedSource
|
||||||
import okio.IOException
|
import okio.IOException
|
||||||
@@ -31,7 +31,7 @@ object ImageSaver {
|
|||||||
val client = OkHttpClient.Builder().build()
|
val client = OkHttpClient.Builder().build()
|
||||||
|
|
||||||
val request = Request.Builder()
|
val request = Request.Builder()
|
||||||
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
|
.header("User-Agent", "Amethyst/${BuildConfig.VERSION_NAME}")
|
||||||
.get()
|
.get()
|
||||||
.url(url)
|
.url(url)
|
||||||
.build()
|
.build()
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
package com.vitorpamplona.amethyst.ui.actions
|
package com.vitorpamplona.amethyst.ui.actions
|
||||||
|
|
||||||
import com.vitorpamplona.amethyst.BuildConfig
|
|
||||||
import android.content.ContentResolver
|
import android.content.ContentResolver
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
||||||
|
import com.vitorpamplona.amethyst.BuildConfig
|
||||||
import okhttp3.*
|
import okhttp3.*
|
||||||
import okhttp3.MediaType.Companion.toMediaType
|
import okhttp3.MediaType.Companion.toMediaType
|
||||||
import okio.BufferedSink
|
import okio.BufferedSink
|
||||||
@@ -45,7 +45,7 @@ object ImageUploader {
|
|||||||
|
|
||||||
val request: Request = Request.Builder()
|
val request: Request = Request.Builder()
|
||||||
.header("Authorization", "Client-ID e6aea87296f3f96")
|
.header("Authorization", "Client-ID e6aea87296f3f96")
|
||||||
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
|
.header("User-Agent", "Amethyst/${BuildConfig.VERSION_NAME}")
|
||||||
.url("https://api.imgur.com/3/image")
|
.url("https://api.imgur.com/3/image")
|
||||||
.post(requestBody)
|
.post(requestBody)
|
||||||
.build()
|
.build()
|
||||||
|
Reference in New Issue
Block a user