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
b9a14855
Commit
b9a14855
authored
Jan 22, 2017
by
Yusuke Iwaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
just rename serverConfigRealm to realmHelper
parent
aee536b9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
RocketChatWebSocketThread.java
...hat/rocket/android/service/RocketChatWebSocketThread.java
+6
-6
No files found.
app/src/main/java/chat/rocket/android/service/RocketChatWebSocketThread.java
View file @
b9a14855
...
@@ -57,7 +57,7 @@ public class RocketChatWebSocketThread extends HandlerThread {
...
@@ -57,7 +57,7 @@ public class RocketChatWebSocketThread extends HandlerThread {
};
};
private
final
Context
appContext
;
private
final
Context
appContext
;
private
final
String
hostname
;
private
final
String
hostname
;
private
final
RealmHelper
serverConfigRealm
;
private
final
RealmHelper
realmHelper
;
private
final
ConnectivityManagerInternal
connectivityManager
;
private
final
ConnectivityManagerInternal
connectivityManager
;
private
final
ArrayList
<
Registrable
>
listeners
=
new
ArrayList
<>();
private
final
ArrayList
<
Registrable
>
listeners
=
new
ArrayList
<>();
private
DDPClientWrapper
ddpClient
;
private
DDPClientWrapper
ddpClient
;
...
@@ -67,7 +67,7 @@ public class RocketChatWebSocketThread extends HandlerThread {
...
@@ -67,7 +67,7 @@ public class RocketChatWebSocketThread extends HandlerThread {
super
(
"RC_thread_"
+
hostname
);
super
(
"RC_thread_"
+
hostname
);
this
.
appContext
=
appContext
;
this
.
appContext
=
appContext
;
this
.
hostname
=
hostname
;
this
.
hostname
=
hostname
;
this
.
serverConfigRealm
=
RealmStore
.
getOrCreate
(
hostname
);
this
.
realmHelper
=
RealmStore
.
getOrCreate
(
hostname
);
this
.
connectivityManager
=
ConnectivityManager
.
getInstanceForInternal
(
appContext
);
this
.
connectivityManager
=
ConnectivityManager
.
getInstanceForInternal
(
appContext
);
}
}
...
@@ -99,7 +99,7 @@ public class RocketChatWebSocketThread extends HandlerThread {
...
@@ -99,7 +99,7 @@ public class RocketChatWebSocketThread extends HandlerThread {
}
}
private
void
forceInvalidateTokens
()
{
private
void
forceInvalidateTokens
()
{
serverConfigRealm
.
executeTransaction
(
realm
->
{
realmHelper
.
executeTransaction
(
realm
->
{
Session
session
=
Session
.
queryDefaultSession
(
realm
).
findFirst
();
Session
session
=
Session
.
queryDefaultSession
(
realm
).
findFirst
();
if
(
session
!=
null
if
(
session
!=
null
&&
!
TextUtils
.
isEmpty
(
session
.
getToken
())
&&
!
TextUtils
.
isEmpty
(
session
.
getToken
())
...
@@ -192,7 +192,7 @@ public class RocketChatWebSocketThread extends HandlerThread {
...
@@ -192,7 +192,7 @@ public class RocketChatWebSocketThread extends HandlerThread {
return
null
;
return
null
;
});
});
return
serverConfigRealm
.
executeTransaction
(
realm
->
{
return
realmHelper
.
executeTransaction
(
realm
->
{
Session
sessionObj
=
Session
.
queryDefaultSession
(
realm
).
findFirst
();
Session
sessionObj
=
Session
.
queryDefaultSession
(
realm
).
findFirst
();
if
(
sessionObj
==
null
)
{
if
(
sessionObj
==
null
)
{
realm
.
createOrUpdateObjectFromJson
(
Session
.
class
,
realm
.
createOrUpdateObjectFromJson
(
Session
.
class
,
...
@@ -223,7 +223,7 @@ public class RocketChatWebSocketThread extends HandlerThread {
...
@@ -223,7 +223,7 @@ public class RocketChatWebSocketThread extends HandlerThread {
}
}
private
Task
<
Void
>
fetchPublicSettings
()
{
private
Task
<
Void
>
fetchPublicSettings
()
{
return
new
MethodCallHelper
(
serverConfigRealm
,
ddpClient
).
getPublicSettings
();
return
new
MethodCallHelper
(
realmHelper
,
ddpClient
).
getPublicSettings
();
}
}
//@DebugLog
//@DebugLog
...
@@ -243,7 +243,7 @@ public class RocketChatWebSocketThread extends HandlerThread {
...
@@ -243,7 +243,7 @@ public class RocketChatWebSocketThread extends HandlerThread {
try
{
try
{
Constructor
ctor
=
clazz
.
getConstructor
(
Context
.
class
,
String
.
class
,
RealmHelper
.
class
,
Constructor
ctor
=
clazz
.
getConstructor
(
Context
.
class
,
String
.
class
,
RealmHelper
.
class
,
DDPClientWrapper
.
class
);
DDPClientWrapper
.
class
);
Object
obj
=
ctor
.
newInstance
(
appContext
,
hostname
,
serverConfigRealm
,
ddpClient
);
Object
obj
=
ctor
.
newInstance
(
appContext
,
hostname
,
realmHelper
,
ddpClient
);
if
(
obj
instanceof
Registrable
)
{
if
(
obj
instanceof
Registrable
)
{
Registrable
registrable
=
(
Registrable
)
obj
;
Registrable
registrable
=
(
Registrable
)
obj
;
...
...
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