Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
fab68e52
Unverified
Commit
fab68e52
authored
Jun 29, 2018
by
Filipe de Lima Brito
Committed by
GitHub
Jun 29, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1413 from RocketChat/new/set-user-agent
[NEW] Set user agent
parents
0cdd58ee
d8a4fc25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
RocketChatClientFactory.kt
...android/server/infraestructure/RocketChatClientFactory.kt
+9
-4
No files found.
app/src/main/java/chat/rocket/android/server/infraestructure/RocketChatClientFactory.kt
View file @
fab68e52
package
chat.rocket.android.server.infraestructure
import
android.os.Build
import
chat.rocket.android.BuildConfig
import
chat.rocket.android.server.domain.TokenRepository
import
chat.rocket.common.util.PlatformLogger
import
chat.rocket.core.RocketChatClient
import
chat.rocket.android.server.domain.TokenRepository
import
okhttp3.OkHttpClient
import
timber.log.Timber
import
javax.inject.Inject
import
javax.inject.Singleton
@Singleton
class
RocketChatClientFactory
@Inject
constructor
(
private
val
okHttpClient
:
OkHttpClient
,
private
val
repository
:
TokenRepository
,
private
val
logger
:
PlatformLogger
)
{
class
RocketChatClientFactory
@Inject
constructor
(
private
val
okHttpClient
:
OkHttpClient
,
private
val
repository
:
TokenRepository
,
private
val
logger
:
PlatformLogger
)
{
private
val
cache
=
HashMap
<
String
,
RocketChatClient
>()
fun
create
(
url
:
String
):
RocketChatClient
{
...
...
@@ -23,6 +27,7 @@ class RocketChatClientFactory @Inject constructor(private val okHttpClient: OkHt
val
client
=
RocketChatClient
.
create
{
httpClient
=
okHttpClient
restUrl
=
url
userAgent
=
"RC Mobile; Android ${Build.VERSION.RELEASE}; v${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})"
tokenRepository
=
repository
platformLogger
=
logger
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment