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
4b2c0db2
Commit
4b2c0db2
authored
Nov 09, 2017
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into fix/irreversible_offline_state
parents
c8094822
8cf95931
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
10 deletions
+31
-10
build.gradle
app/build.gradle
+7
-0
MethodCallHelper.java
...c/main/java/chat/rocket/android/api/MethodCallHelper.java
+16
-8
LoginPresenter.java
...rocket/android/fragment/server_config/LoginPresenter.java
+1
-1
TwoStepAuthPresenter.java
.../android/fragment/server_config/TwoStepAuthPresenter.java
+2
-1
circle.yml
circle.yml
+5
-0
No files found.
app/build.gradle
View file @
4b2c0db2
...
...
@@ -83,6 +83,13 @@ android {
androidTest
.
java
.
srcDirs
+=
'src/androidTest/kotlin'
}
}
dexOptions
{
if
(
System
.
getenv
()[
"CIRCLECI"
]
as
boolean
)
{
javaMaxHeapSize
"1536M"
preDexLibraries
false
}
}
}
play
{
...
...
app/src/main/java/chat/rocket/android/api/MethodCallHelper.java
View file @
4b2c0db2
...
...
@@ -74,7 +74,13 @@ public class MethodCallHelper {
private
Task
<
String
>
executeMethodCall
(
String
methodName
,
String
param
,
long
timeout
)
{
if
(
DDPClient
.
get
()
!=
null
)
{
return
DDPClient
.
get
().
rpc
(
UUID
.
randomUUID
().
toString
(),
methodName
,
param
,
timeout
)
.
onSuccessTask
(
task
->
Task
.
forResult
(
task
.
getResult
().
result
));
.
onSuccessTask
(
task
->
Task
.
forResult
(
task
.
getResult
().
result
))
.
continueWithTask
(
task_
->
{
if
(
task_
.
isFaulted
())
{
return
Task
.
forError
(
task_
.
getError
());
}
return
Task
.
forResult
(
task_
.
getResult
());
});
}
else
{
return
MethodCall
.
execute
(
realmHelper
,
methodName
,
param
,
timeout
)
.
onSuccessTask
(
task
->
{
...
...
@@ -89,8 +95,13 @@ public class MethodCallHelper {
return
task
.
continueWithTask
(
_task
->
{
if
(
_task
.
isFaulted
())
{
Exception
exception
=
_task
.
getError
();
if
(
exception
instanceof
MethodCall
.
Error
)
{
String
errMessageJson
=
exception
.
getMessage
();
if
(
exception
instanceof
MethodCall
.
Error
||
exception
instanceof
DDPClientCallback
.
RPC
.
Error
)
{
String
errMessageJson
;
if
(
exception
instanceof
DDPClientCallback
.
RPC
.
Error
)
{
errMessageJson
=
((
DDPClientCallback
.
RPC
.
Error
)
exception
).
error
.
toString
();
}
else
{
errMessageJson
=
exception
.
getMessage
();
}
if
(
TextUtils
.
isEmpty
(
errMessageJson
))
{
return
Task
.
forError
(
exception
);
}
...
...
@@ -101,9 +112,6 @@ public class MethodCallHelper {
return
Task
.
forError
(
new
TwoStepAuthException
(
errMessage
));
}
return
Task
.
forError
(
new
Exception
(
errMessage
));
}
else
if
(
exception
instanceof
DDPClientCallback
.
RPC
.
Error
)
{
String
errMessage
=
((
DDPClientCallback
.
RPC
.
Error
)
exception
).
error
.
getString
(
"message"
);
return
Task
.
forError
(
new
Exception
(
errMessage
));
}
else
if
(
exception
instanceof
DDPClientCallback
.
RPC
.
Timeout
)
{
return
Task
.
forError
(
new
MethodCall
.
Timeout
());
}
else
{
...
...
@@ -184,8 +192,8 @@ public class MethodCallHelper {
.
put
(
"algorithm"
,
"sha-256"
));
return
new
JSONArray
().
put
(
param
);
}).
onSuccessTask
(
CONVERT_TO_JSON_OBJECT
)
.
onSuccessTask
(
task
->
Task
.
forResult
(
task
.
getResult
().
getString
(
"token"
)))
.
onSuccessTask
(
this
::
saveToken
);
.
onSuccessTask
(
task
->
Task
.
forResult
(
task
.
getResult
().
getString
(
"token"
)))
.
onSuccessTask
(
this
::
saveToken
);
}
public
Task
<
Void
>
loginWithLdap
(
final
String
username
,
final
String
password
)
{
...
...
app/src/main/java/chat/rocket/android/fragment/server_config/LoginPresenter.java
View file @
4b2c0db2
...
...
@@ -85,7 +85,7 @@ public class LoginPresenter extends BasePresenter<LoginContract.View>
}
}
return
null
;
});
}
,
Task
.
UI_THREAD_EXECUTOR
);
}
private
Task
<
Void
>
call
(
String
username
,
String
password
,
Optional
<
PublicSetting
>
optional
)
{
...
...
app/src/main/java/chat/rocket/android/fragment/server_config/TwoStepAuthPresenter.java
View file @
4b2c0db2
package
chat
.
rocket
.
android
.
fragment
.
server_config
;
import
bolts.Task
;
import
chat.rocket.android.api.MethodCallHelper
;
import
chat.rocket.android.shared.BasePresenter
;
...
...
@@ -29,6 +30,6 @@ public class TwoStepAuthPresenter extends BasePresenter<TwoStepAuthContract.View
view
.
showError
(
task
.
getError
().
getMessage
());
}
return
null
;
});
}
,
Task
.
UI_THREAD_EXECUTOR
);
}
}
circle.yml
View file @
4b2c0db2
...
...
@@ -8,9 +8,14 @@ machine:
environment
:
ANDROID_HOME
:
/usr/local/android-sdk-linux
GRADLE_OPTS
:
'
-Dorg.gradle.jvmargs="-Xmx1536m
-XX:MaxPermSize=512m
-XX:+HeapDumpOnOutOfMemoryError"'
JAVA_OPTS
:
"
-Xms518m
-Xmx1536m"
dependencies
:
pre
:
-
sudo service mysql stop; sleep 5
-
sudo service mongod stop; sleep 5
-
sudo killall postgres; sleep 5
-
git fetch --tags
-
echo "sdk.dir="$ANDROID_HOME > local.properties
...
...
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