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
a6980d0e
Commit
a6980d0e
authored
Aug 23, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update classes.
parent
e09e0cff
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
10 deletions
+10
-10
RocketChatApplication.java
.../main/java/chat/rocket/android/RocketChatApplication.java
+2
-2
DDPClientWrapper.java
...c/main/java/chat/rocket/android/api/DDPClientWrapper.java
+2
-2
InputHostnamePresenter.java
...t/android/fragment/add_server/InputHostnamePresenter.java
+2
-2
FileUploadingToUrlObserver.java
.../android/service/observer/FileUploadingToUrlObserver.java
+2
-2
FileUploadingWithUfsObserver.java
...ndroid/service/observer/FileUploadingWithUfsObserver.java
+2
-2
No files found.
app/src/main/java/chat/rocket/android/RocketChatApplication.java
View file @
a6980d0e
package
chat
.
rocket
.
android
;
import
android.support.multidex.MultiDexApplication
;
import
chat.rocket.android.helper.OkHttpHelper
;
import
com.crashlytics.android.Crashlytics
;
import
io.fabric.sdk.android.Fabric
;
import
java.util.List
;
import
chat.rocket.android.helper.OkHttpHelper
;
import
chat.rocket.persistence.realm.RealmStore
;
import
chat.rocket.android.service.ConnectivityManager
;
import
chat.rocket.core.models.ServerInfo
;
...
...
@@ -29,6 +29,6 @@ public class RocketChatApplication extends MultiDexApplication {
RealmStore
.
put
(
serverInfo
.
getHostname
());
}
RocketChatWidgets
.
initialize
(
this
,
OkHttpHelper
.
getClientForDownloadFile
(
this
));
RocketChatWidgets
.
initialize
(
this
,
OkHttpHelper
.
INSTANCE
.
getClientForDownloadFile
(
this
));
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/api/DDPClientWrapper.java
View file @
a6980d0e
...
...
@@ -2,13 +2,13 @@ package chat.rocket.android.api;
import
android.support.annotation.Nullable
;
import
chat.rocket.android.helper.OkHttpHelper
;
import
org.json.JSONArray
;
import
org.json.JSONException
;
import
java.util.UUID
;
import
bolts.Task
;
import
chat.rocket.android.helper.OkHttpHelper
;
import
chat.rocket.android.helper.TextUtils
;
import
chat.rocket.android.log.RCLog
;
import
chat.rocket.android_ddp.DDPClient
;
...
...
@@ -25,7 +25,7 @@ public class DDPClientWrapper {
private
final
String
hostname
;
private
DDPClientWrapper
(
String
hostname
)
{
ddpClient
=
new
DDPClient
(
OkHttpHelper
.
getClientForWebSocket
());
ddpClient
=
new
DDPClient
(
OkHttpHelper
.
INSTANCE
.
getClientForWebSocket
());
this
.
hostname
=
hostname
;
}
...
...
app/src/main/java/chat/rocket/android/fragment/add_server/InputHostnamePresenter.java
View file @
a6980d0e
package
chat
.
rocket
.
android
.
fragment
.
add_server
;
import
chat.rocket.android.BackgroundLooper
;
import
chat.rocket.android.helper.OkHttpHelper
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.disposables.Disposable
;
import
chat.rocket.android.RocketChatCache
;
import
chat.rocket.android.api.rest.DefaultServerPolicyApi
;
import
chat.rocket.android.api.rest.ServerPolicyApi
;
import
chat.rocket.android.helper.OkHttpHelper
;
import
chat.rocket.android.helper.ServerPolicyApiValidationHelper
;
import
chat.rocket.android.helper.ServerPolicyHelper
;
import
chat.rocket.android.service.ConnectivityManagerApi
;
...
...
@@ -29,7 +29,7 @@ public class InputHostnamePresenter extends BasePresenter<InputHostnameContract.
}
public
void
connectToEnforced
(
final
String
hostname
)
{
final
ServerPolicyApi
serverPolicyApi
=
new
DefaultServerPolicyApi
(
OkHttpHelper
.
getClientForUploadFile
(),
hostname
);
final
ServerPolicyApi
serverPolicyApi
=
new
DefaultServerPolicyApi
(
OkHttpHelper
.
INSTANCE
.
getClientForUploadFile
(),
hostname
);
final
ServerPolicyApiValidationHelper
validationHelper
=
new
ServerPolicyApiValidationHelper
(
serverPolicyApi
);
clearSubscriptions
();
...
...
app/src/main/java/chat/rocket/android/service/observer/FileUploadingToUrlObserver.java
View file @
a6980d0e
...
...
@@ -2,6 +2,7 @@ package chat.rocket.android.service.observer;
import
android.content.Context
;
import
android.net.Uri
;
import
chat.rocket.android.helper.OkHttpHelper
;
import
io.realm.Realm
;
import
io.realm.RealmResults
;
import
org.json.JSONArray
;
...
...
@@ -13,7 +14,6 @@ import java.util.List;
import
bolts.Task
;
import
chat.rocket.android.api.FileUploadingHelper
;
import
chat.rocket.android.helper.LogIfError
;
import
chat.rocket.android.helper.OkHttpHelper
;
import
chat.rocket.android.log.RCLog
;
import
chat.rocket.core.SyncState
;
import
chat.rocket.persistence.realm.models.internal.FileUploading
;
...
...
@@ -167,7 +167,7 @@ public class FileUploadingToUrlObserver extends AbstractModelObserver<FileUpload
.
post
(
bodyBuilder
.
build
())
.
build
();
Response
response
=
OkHttpHelper
.
getClientForUploadFile
().
newCall
(
request
).
execute
();
Response
response
=
OkHttpHelper
.
INSTANCE
.
getClientForUploadFile
().
newCall
(
request
).
execute
();
if
(
response
.
isSuccessful
())
{
return
Task
.
forResult
(
downloadUrl
);
}
else
{
...
...
app/src/main/java/chat/rocket/android/service/observer/FileUploadingWithUfsObserver.java
View file @
a6980d0e
...
...
@@ -2,6 +2,7 @@ package chat.rocket.android.service.observer;
import
android.content.Context
;
import
android.net.Uri
;
import
chat.rocket.android.helper.OkHttpHelper
;
import
io.realm.Realm
;
import
io.realm.RealmResults
;
import
org.json.JSONObject
;
...
...
@@ -11,7 +12,6 @@ import java.util.List;
import
bolts.Task
;
import
chat.rocket.android.api.FileUploadingHelper
;
import
chat.rocket.android.helper.LogIfError
;
import
chat.rocket.android.helper.OkHttpHelper
;
import
chat.rocket.android.log.RCLog
;
import
chat.rocket.core.SyncState
;
import
chat.rocket.persistence.realm.models.ddp.RealmUser
;
...
...
@@ -143,7 +143,7 @@ public class FileUploadingWithUfsObserver extends AbstractModelObserver<FileUplo
.
post
(
RequestBody
.
create
(
contentType
,
buffer
,
0
,
read
))
.
build
();
Response
response
=
OkHttpHelper
.
getClientForUploadFile
().
newCall
(
request
).
execute
();
Response
response
=
OkHttpHelper
.
INSTANCE
.
getClientForUploadFile
().
newCall
(
request
).
execute
();
if
(
response
.
isSuccessful
())
{
final
JSONObject
obj
=
new
JSONObject
()
.
put
(
FileUploading
.
ID
,
uplId
)
...
...
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