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
516f941d
Unverified
Commit
516f941d
authored
Apr 03, 2018
by
Pancor
Committed by
GitHub
Apr 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add support for muliserver
parent
1a0398f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
ChatRoomPresenter.kt
...rocket/android/chatroom/presentation/ChatRoomPresenter.kt
+11
-12
No files found.
app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt
View file @
516f941d
...
...
@@ -49,8 +49,7 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
private
val
roomsRepository
:
RoomRepository
,
private
val
localRepository
:
LocalRepository
,
factory
:
ConnectionManagerFactory
,
private
val
mapper
:
ViewModelMapper
,
private
val
localRepository
:
LocalRepository
)
{
private
val
mapper
:
ViewModelMapper
)
{
private
val
currentServer
=
serverInteractor
.
get
()
!!
private
val
manager
=
factory
.
create
(
currentServer
)
private
val
client
=
manager
.
client
...
...
@@ -85,8 +84,8 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
ex
.
message
?.
let
{
view
.
showMessage
(
it
)
}.
ifNull
{
view
.
showGenericErrorMessage
()
}
view
.
showGenericErrorMessage
()
}
}
finally
{
view
.
hideLoading
()
}
...
...
@@ -112,8 +111,8 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
ex
.
message
?.
let
{
view
.
showMessage
(
it
)
}.
ifNull
{
view
.
showGenericErrorMessage
()
}
view
.
showGenericErrorMessage
()
}
}
finally
{
view
.
enableSendMessageButton
()
}
...
...
@@ -148,8 +147,8 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
ex
.
message
?.
let
{
view
.
showMessage
(
it
)
}.
ifNull
{
view
.
showGenericErrorMessage
()
}
view
.
showGenericErrorMessage
()
}
}
finally
{
view
.
hideLoading
()
}
...
...
@@ -164,7 +163,7 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
view
.
showMessage
(
ex
.
message
!!
)
// TODO Remove.
Timber
.
e
(
ex
)
// FIXME: Right now we are only catching the exception with Timber.
}
}
}
}
private
fun
subscribeState
()
{
...
...
@@ -563,7 +562,7 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
* @param unfinishedMessage The unfinished message to save.
*/
fun
saveUnfinishedMessage
(
chatRoomId
:
String
,
unfinishedMessage
:
String
)
{
val
key
=
LocalRepository
.
UNFINISHED_MSG_KEY
+
chatRoomId
val
key
=
"${currentServer}_${LocalRepository.UNFINISHED_MSG_KEY}$chatRoomId"
if
(
unfinishedMessage
.
isNotBlank
())
{
localRepository
.
save
(
key
,
unfinishedMessage
)
}
else
{
...
...
@@ -580,7 +579,7 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
* @return Returns the unfinished message.
*/
fun
getUnfinishedMessage
(
chatRoomId
:
String
):
String
{
val
key
=
LocalRepository
.
UNFINISHED_MSG_KEY
+
chatRoomId
val
key
=
"${currentServer}_${LocalRepository.UNFINISHED_MSG_KEY}$chatRoomId"
return
localRepository
.
get
(
key
)
?:
""
}
}
\ No newline at end of file
}
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