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
6597044b
Commit
6597044b
authored
Jan 23, 2017
by
Yusuke Iwaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor
parent
bc9a6641
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
12 deletions
+5
-12
RocketChatService.java
...n/java/chat/rocket/android/service/RocketChatService.java
+1
-3
RocketChatWebSocketThread.java
...hat/rocket/android/service/RocketChatWebSocketThread.java
+4
-9
No files found.
app/src/main/java/chat/rocket/android/service/RocketChatService.java
View file @
6597044b
...
...
@@ -103,9 +103,7 @@ public class RocketChatService extends Service implements ConnectivityServiceInt
}
webSocketThreads
.
put
(
hostname
,
null
);
return
RocketChatWebSocketThread
.
getStarted
(
getApplicationContext
(),
hostname
)
.
doOnSuccess
(
thread
->
{
webSocketThreads
.
put
(
hostname
,
thread
);
});
.
doOnSuccess
(
thread
->
webSocketThreads
.
put
(
hostname
,
thread
));
});
}
...
...
app/src/main/java/chat/rocket/android/service/RocketChatWebSocketThread.java
View file @
6597044b
...
...
@@ -33,8 +33,6 @@ import chat.rocket.android.service.observer.SessionObserver;
import
chat.rocket.android.service.observer.TokenLoginObserver
;
import
hugo.weaving.DebugLog
;
import
rx.Single
;
import
rx.SingleEmitter
;
import
rx.functions.Action1
;
/**
* Thread for handling WebSocket connection.
...
...
@@ -266,13 +264,10 @@ public class RocketChatWebSocketThread extends HandlerThread {
@DebugLog
private
Single
<
Boolean
>
connect
()
{
return
connectDDPClient
()
.
flatMap
(
_val
->
Single
.
fromEmitter
(
new
Action1
<
SingleEmitter
<
Boolean
>>()
{
@Override
public
void
call
(
SingleEmitter
<
Boolean
>
emitter
)
{
fetchPublicSettings
();
registerListeners
();
emitter
.
onSuccess
(
true
);
}
.
flatMap
(
_val
->
Single
.
fromEmitter
(
emitter
->
{
fetchPublicSettings
();
registerListeners
();
emitter
.
onSuccess
(
true
);
}));
}
...
...
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