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
f6fb3f61
Commit
f6fb3f61
authored
Nov 10, 2016
by
Yusuke Iwaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix connection error handling on token login.
parent
d8f0d912
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
RocketChatService.java
...n/java/chat/rocket/android/service/RocketChatService.java
+14
-1
TokenLoginObserver.java
...t/rocket/android/service/observer/TokenLoginObserver.java
+1
-0
No files found.
app/src/main/java/chat/rocket/android/service/RocketChatService.java
View file @
f6fb3f61
...
...
@@ -15,6 +15,7 @@ import java.util.Iterator;
import
java.util.List
;
import
java.util.Map
;
import
jp.co.crowdworks.realm_java_helpers.RealmListObserver
;
import
jp.co.crowdworks.realm_java_helpers_bolts.RealmHelperBolts
;
/**
* Background service for Rocket.Chat.Application class.
...
...
@@ -59,7 +60,19 @@ public class RocketChatService extends Service {
}
@Override
public
int
onStartCommand
(
Intent
intent
,
int
flags
,
int
startId
)
{
connectionRequiredServerConfigObserver
.
keepalive
();
RealmHelperBolts
.
executeTransaction
(
realm
->
{
RealmResults
<
ServerConfig
>
targetConfigs
=
realm
.
where
(
ServerConfig
.
class
)
.
isNotNull
(
"token"
)
.
isNotNull
(
"connectionError"
)
.
findAll
();
for
(
ServerConfig
config
:
targetConfigs
)
{
config
.
setConnectionError
(
null
);
}
return
null
;
}).
onSuccessTask
(
task
->
{
connectionRequiredServerConfigObserver
.
keepalive
();
return
null
;
});
return
START_STICKY
;
}
...
...
app/src/main/java/chat/rocket/android/service/observer/TokenLoginObserver.java
View file @
f6fb3f61
...
...
@@ -17,6 +17,7 @@ public class TokenLoginObserver extends AbstractModelObserver<ServerConfig> {
@Override
protected
RealmResults
<
ServerConfig
>
queryItems
(
Realm
realm
)
{
return
realm
.
where
(
ServerConfig
.
class
)
.
isNotNull
(
"session"
)
.
isNotNull
(
"token"
)
.
equalTo
(
"tokenVerified"
,
false
)
.
findAll
();
...
...
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