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
477d12ab
Commit
477d12ab
authored
Apr 02, 2018
by
Lucio Maciel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing parameter to ChatRoom
parent
b6b86885
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
45 deletions
+54
-45
ChatRoomsPresenter.kt
...cket/android/chatrooms/presentation/ChatRoomsPresenter.kt
+54
-45
No files found.
app/src/main/java/chat/rocket/android/chatrooms/presentation/ChatRoomsPresenter.kt
View file @
477d12ab
...
...
@@ -2,11 +2,16 @@ package chat.rocket.android.chatrooms.presentation
import
chat.rocket.android.chatroom.viewmodel.ViewModelMapper
import
chat.rocket.android.core.lifecycle.CancelStrategy
import
chat.rocket.android.main.presentation.MainNavigator
import
chat.rocket.android.helper.ChatRoomsSortOrder
import
chat.rocket.android.helper.Constants
import
chat.rocket.android.helper.SharedPreferenceHelper
import
chat.rocket.android.server.domain.*
import
chat.rocket.android.main.presentation.MainNavigator
import
chat.rocket.android.server.domain.GetChatRoomsInteractor
import
chat.rocket.android.server.domain.GetCurrentServerInteractor
import
chat.rocket.android.server.domain.RefreshSettingsInteractor
import
chat.rocket.android.server.domain.SaveChatRoomsInteractor
import
chat.rocket.android.server.domain.SettingsRepository
import
chat.rocket.android.server.domain.useRealName
import
chat.rocket.android.server.infraestructure.ConnectionManager
import
chat.rocket.android.server.infraestructure.ConnectionManagerFactory
import
chat.rocket.android.server.infraestructure.chatRooms
...
...
@@ -23,14 +28,16 @@ import chat.rocket.core.internal.realtime.StreamMessage
import
chat.rocket.core.internal.realtime.Type
import
chat.rocket.core.internal.rest.spotlight
import
chat.rocket.core.model.ChatRoom
import
chat.rocket.core.model.Message
import
chat.rocket.core.model.Room
import
kotlinx.coroutines.experimental.*
import
kotlinx.coroutines.experimental.CommonPool
import
kotlinx.coroutines.experimental.Deferred
import
kotlinx.coroutines.experimental.android.UI
import
kotlinx.coroutines.experimental.async
import
kotlinx.coroutines.experimental.channels.Channel
import
kotlinx.coroutines.experimental.delay
import
kotlinx.coroutines.experimental.launch
import
timber.log.Timber
import
javax.inject.Inject
import
kotlin.reflect.KProperty
import
kotlin.reflect.KProperty1
class
ChatRoomsPresenter
@Inject
constructor
(
private
val
view
:
ChatRoomsView
,
...
...
@@ -341,26 +348,27 @@ class ChatRoomsPresenter @Inject constructor(private val view: ChatRoomsView,
val
chatRooms
=
getChatRoomsInteractor
.
get
(
currentServer
).
toMutableList
()
val
chatRoom
=
chatRooms
.
find
{
chatRoom
->
chatRoom
.
id
==
room
.
id
}
chatRoom
?.
apply
{
val
newRoom
=
ChatRoom
(
room
.
id
,
room
.
type
,
room
.
user
?:
user
,
room
.
name
?:
name
,
room
.
fullName
?:
fullName
,
room
.
readonly
,
room
.
updatedAt
?:
updatedAt
,
timestamp
,
lastSeen
,
room
.
topic
,
room
.
description
,
room
.
announcement
,
default
,
open
,
alert
,
unread
,
userMenstions
,
groupMentions
,
room
.
lastMessage
,
client
)
val
newRoom
=
ChatRoom
(
id
=
room
.
id
,
type
=
room
.
type
,
user
=
room
.
user
?:
user
,
name
=
room
.
name
?:
name
,
fullName
=
room
.
fullName
?:
fullName
,
readonly
=
room
.
readonly
,
updatedAt
=
room
.
updatedAt
?:
updatedAt
,
timestamp
=
timestamp
,
lastSeen
=
lastSeen
,
topic
=
room
.
topic
,
description
=
room
.
description
,
announcement
=
room
.
announcement
,
default
=
default
,
favorite
=
favorite
,
open
=
open
,
alert
=
alert
,
unread
=
unread
,
userMenstions
=
userMenstions
,
groupMentions
=
groupMentions
,
lastMessage
=
room
.
lastMessage
,
client
=
client
)
removeRoom
(
room
.
id
,
chatRooms
)
chatRooms
.
add
(
newRoom
)
saveChatRoomsInteractor
.
save
(
currentServer
,
sortRooms
(
chatRooms
))
...
...
@@ -373,26 +381,27 @@ class ChatRoomsPresenter @Inject constructor(private val view: ChatRoomsView,
val
chatRooms
=
getChatRoomsInteractor
.
get
(
currentServer
).
toMutableList
()
val
chatRoom
=
chatRooms
.
find
{
chatRoom
->
chatRoom
.
id
==
subscription
.
roomId
}
chatRoom
?.
apply
{
val
newRoom
=
ChatRoom
(
subscription
.
roomId
,
subscription
.
type
,
subscription
.
user
?:
user
,
subscription
.
name
,
subscription
.
fullName
?:
fullName
,
subscription
.
readonly
?:
readonly
,
subscription
.
updatedAt
?:
updatedAt
,
subscription
.
timestamp
?:
timestamp
,
subscription
.
lastSeen
?:
lastSeen
,
topic
,
description
,
announcement
,
subscription
.
isDefault
,
subscription
.
open
,
subscription
.
alert
,
subscription
.
unread
,
subscription
.
userMentions
,
subscription
.
groupMentions
,
lastMessage
,
client
)
val
newRoom
=
ChatRoom
(
id
=
subscription
.
roomId
,
type
=
subscription
.
type
,
user
=
subscription
.
user
?:
user
,
name
=
subscription
.
name
,
fullName
=
subscription
.
fullName
?:
fullName
,
readonly
=
subscription
.
readonly
?:
readonly
,
updatedAt
=
subscription
.
updatedAt
?:
updatedAt
,
timestamp
=
subscription
.
timestamp
?:
timestamp
,
lastSeen
=
subscription
.
lastSeen
?:
lastSeen
,
topic
=
topic
,
description
=
description
,
announcement
=
announcement
,
default
=
subscription
.
isDefault
,
favorite
=
subscription
.
isFavorite
,
open
=
subscription
.
open
,
alert
=
subscription
.
alert
,
unread
=
subscription
.
unread
,
userMenstions
=
subscription
.
userMentions
,
groupMentions
=
subscription
.
groupMentions
,
lastMessage
=
lastMessage
,
client
=
client
)
removeRoom
(
subscription
.
roomId
,
chatRooms
)
chatRooms
.
add
(
newRoom
)
saveChatRoomsInteractor
.
save
(
currentServer
,
sortRooms
(
chatRooms
))
...
...
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