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
a78c1b6c
Commit
a78c1b6c
authored
Jan 31, 2017
by
Tiago Cunha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified method return
parent
857c8cf2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
13 deletions
+3
-13
MethodCallHelper.java
...c/main/java/chat/rocket/android/api/MethodCallHelper.java
+3
-13
No files found.
app/src/main/java/chat/rocket/android/api/MethodCallHelper.java
View file @
a78c1b6c
...
@@ -301,7 +301,7 @@ public class MethodCallHelper {
...
@@ -301,7 +301,7 @@ public class MethodCallHelper {
/**
/**
* send message.
* send message.
*/
*/
public
Task
<
JSONObject
>
sendMessage
(
String
messageId
,
String
roomId
,
String
msg
)
{
public
Task
<
Void
>
sendMessage
(
String
messageId
,
String
roomId
,
String
msg
)
{
try
{
try
{
return
sendMessage
(
new
JSONObject
()
return
sendMessage
(
new
JSONObject
()
.
put
(
"_id"
,
messageId
)
.
put
(
"_id"
,
messageId
)
...
@@ -315,19 +315,9 @@ public class MethodCallHelper {
...
@@ -315,19 +315,9 @@ public class MethodCallHelper {
/**
/**
* Send message object.
* Send message object.
*/
*/
private
Task
<
JSONObject
>
sendMessage
(
final
JSONObject
messageJson
)
{
private
Task
<
Void
>
sendMessage
(
final
JSONObject
messageJson
)
{
return
call
(
"sendMessage"
,
TIMEOUT_MS
,
()
->
new
JSONArray
().
put
(
messageJson
))
return
call
(
"sendMessage"
,
TIMEOUT_MS
,
()
->
new
JSONArray
().
put
(
messageJson
))
.
onSuccessTask
(
task
->
{
.
onSuccessTask
(
task
->
Task
.
forResult
(
null
));
final
String
result
=
task
.
getResult
();
if
(
result
.
equals
(
""
))
{
// valid success result
return
Task
.
forResult
(
new
JSONObject
());
}
// should validate any other response
final
JSONObject
jsonObject
=
new
JSONObject
(
result
);
return
Task
.
forResult
(
Message
.
customizeJson
(
jsonObject
));
});
}
}
/**
/**
...
...
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