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
4f259cc3
Commit
4f259cc3
authored
Mar 22, 2017
by
Tiago Cunha
Committed by
GitHub
Mar 22, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #243 from RocketChat/fix/room-npe
Crashes
parents
b704af6f
54b7af44
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
17 deletions
+19
-17
DefaultServerPolicyApi.java
.../chat/rocket/android/api/rest/DefaultServerPolicyApi.java
+8
-0
InputHostnamePresenter.java
...t/android/fragment/add_server/InputHostnamePresenter.java
+1
-3
RoomContract.java
...a/chat/rocket/android/fragment/chatroom/RoomContract.java
+0
-2
RoomFragment.java
...a/chat/rocket/android/fragment/chatroom/RoomFragment.java
+0
-2
RoomPresenter.java
.../chat/rocket/android/fragment/chatroom/RoomPresenter.java
+10
-10
No files found.
app/src/main/java/chat/rocket/android/api/rest/DefaultServerPolicyApi.java
View file @
4f259cc3
...
@@ -57,11 +57,19 @@ public class DefaultServerPolicyApi implements ServerPolicyApi {
...
@@ -57,11 +57,19 @@ public class DefaultServerPolicyApi implements ServerPolicyApi {
return
new
okhttp3
.
Callback
()
{
return
new
okhttp3
.
Callback
()
{
@Override
@Override
public
void
onFailure
(
Call
call
,
IOException
ioException
)
{
public
void
onFailure
(
Call
call
,
IOException
ioException
)
{
if
(
emitter
.
isCancelled
())
{
return
;
}
emitter
.
onError
(
ioException
);
emitter
.
onError
(
ioException
);
}
}
@Override
@Override
public
void
onResponse
(
Call
call
,
okhttp3
.
Response
response
)
throws
IOException
{
public
void
onResponse
(
Call
call
,
okhttp3
.
Response
response
)
throws
IOException
{
if
(
emitter
.
isCancelled
())
{
return
;
}
if
(!
response
.
isSuccessful
())
{
if
(!
response
.
isSuccessful
())
{
emitter
.
onNext
(
new
Response
<>(
false
,
protocol
,
null
));
emitter
.
onNext
(
new
Response
<>(
false
,
protocol
,
null
));
emitter
.
onComplete
();
emitter
.
onComplete
();
...
...
app/src/main/java/chat/rocket/android/fragment/add_server/InputHostnamePresenter.java
View file @
4f259cc3
...
@@ -53,9 +53,7 @@ public class InputHostnamePresenter extends BasePresenter<InputHostnameContract.
...
@@ -53,9 +53,7 @@ public class InputHostnamePresenter extends BasePresenter<InputHostnameContract.
view
.
showInvalidServerError
();
view
.
showInvalidServerError
();
}
}
},
},
throwable
->
{
throwable
->
view
.
showConnectionError
());
view
.
showConnectionError
();
});
addSubscription
(
subscription
);
addSubscription
(
subscription
);
}
}
...
...
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomContract.java
View file @
4f259cc3
...
@@ -36,8 +36,6 @@ public interface RoomContract {
...
@@ -36,8 +36,6 @@ public interface RoomContract {
void
loadMoreMessages
();
void
loadMoreMessages
();
void
onViewSetup
();
void
onMessageSelected
(
@Nullable
Message
message
);
void
onMessageSelected
(
@Nullable
Message
message
);
void
sendMessage
(
String
messageText
);
void
sendMessage
(
String
messageText
);
...
...
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomFragment.java
View file @
4f259cc3
...
@@ -202,8 +202,6 @@ public class RoomFragment extends AbstractChatRoomFragment
...
@@ -202,8 +202,6 @@ public class RoomFragment extends AbstractChatRoomFragment
setupSideMenu
();
setupSideMenu
();
setupMessageComposer
();
setupMessageComposer
();
setupMessageActions
();
setupMessageActions
();
presenter
.
onViewSetup
();
}
}
private
void
setupMessageActions
()
{
private
void
setupMessageActions
()
{
...
...
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomPresenter.java
View file @
4f259cc3
...
@@ -59,6 +59,7 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
...
@@ -59,6 +59,7 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
getRoomHistoryStateInfo
();
getRoomHistoryStateInfo
();
getMessages
();
getMessages
();
getUserPreferences
();
getUserPreferences
();
getAbsoluteUrl
();
}
}
@Override
@Override
...
@@ -76,16 +77,6 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
...
@@ -76,16 +77,6 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
addSubscription
(
subscription
);
addSubscription
(
subscription
);
}
}
@Override
public
void
onViewSetup
()
{
final
Disposable
subscription
=
absoluteUrlHelper
.
getRocketChatAbsoluteUrl
()
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
it
->
view
.
setupWith
(
it
.
orNull
()));
addSubscription
(
subscription
);
}
@Override
@Override
public
void
loadMoreMessages
()
{
public
void
loadMoreMessages
()
{
...
@@ -248,6 +239,15 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
...
@@ -248,6 +239,15 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
addSubscription
(
subscription
);
addSubscription
(
subscription
);
}
}
private
void
getAbsoluteUrl
()
{
final
Disposable
subscription
=
absoluteUrlHelper
.
getRocketChatAbsoluteUrl
()
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
it
->
view
.
setupWith
(
it
.
orNull
()));
addSubscription
(
subscription
);
}
private
Single
<
Pair
<
Room
,
User
>>
getRoomUserPair
()
{
private
Single
<
Pair
<
Room
,
User
>>
getRoomUserPair
()
{
return
Single
.
zip
(
return
Single
.
zip
(
getSingleRoom
(),
getSingleRoom
(),
...
...
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