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
7d813c93
Commit
7d813c93
authored
Mar 29, 2018
by
Lucio Maciel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compilation fixes
parent
9876f654
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
11 deletions
+47
-11
SignupPresenter.kt
...oid/authentication/signup/presentation/SignupPresenter.kt
+5
-2
ChatRoomsPresenter.kt
...cket/android/chatrooms/presentation/ChatRoomsPresenter.kt
+42
-9
No files found.
app/src/main/java/chat/rocket/android/authentication/signup/presentation/SignupPresenter.kt
View file @
7d813c93
...
...
@@ -10,6 +10,7 @@ import chat.rocket.android.server.domain.*
import
chat.rocket.android.server.domain.model.Account
import
chat.rocket.android.server.infraestructure.RocketChatClientFactory
import
chat.rocket.android.util.extensions.launchUI
import
chat.rocket.android.util.extensions.registerPushToken
import
chat.rocket.common.RocketChatException
import
chat.rocket.common.util.ifNull
import
chat.rocket.core.RocketChatClient
...
...
@@ -27,6 +28,7 @@ class SignupPresenter @Inject constructor(private val view: SignupView,
private
val
serverInteractor
:
GetCurrentServerInteractor
,
private
val
factory
:
RocketChatClientFactory
,
private
val
saveAccountInteractor
:
SaveAccountInteractor
,
private
val
getAccountsInteractor
:
GetAccountsInteractor
,
settingsInteractor
:
GetSettingsInteractor
)
{
private
val
currentServer
=
serverInteractor
.
get
()
!!
private
val
client
:
RocketChatClient
=
factory
.
create
(
currentServer
)
...
...
@@ -98,9 +100,10 @@ class SignupPresenter @Inject constructor(private val view: SignupView,
private
suspend
fun
registerPushToken
()
{
localRepository
.
get
(
LocalRepository
.
KEY_PUSH_TOKEN
)
?.
let
{
client
.
registerPushToken
(
it
)
client
.
registerPushToken
(
it
,
getAccountsInteractor
.
get
(),
factory
)
}
// TODO: Schedule push token registering when it comes up null
// TODO: When the push token is null, at some point we should receive it with
// onTokenRefresh() on FirebaseTokenService, we need to confirm it.
}
private
suspend
fun
saveAccount
(
me
:
Myself
)
{
...
...
app/src/main/java/chat/rocket/android/chatrooms/presentation/ChatRoomsPresenter.kt
View file @
7d813c93
...
...
@@ -101,21 +101,52 @@ class ChatRoomsPresenter @Inject constructor(private val view: ChatRoomsView,
private
suspend
fun
usersToChatRooms
(
users
:
List
<
User
>):
List
<
ChatRoom
>
{
return
users
.
map
{
ChatRoom
(
it
.
id
,
RoomType
.
DIRECT_MESSAGE
,
SimpleUser
(
username
=
it
.
username
,
name
=
it
.
name
,
id
=
null
),
it
.
name
?:
""
,
it
.
name
,
false
,
null
,
null
,
null
,
null
,
null
,
false
,
false
,
false
,
0L
,
null
,
0L
,
null
,
client
ChatRoom
(
id
=
it
.
id
,
type
=
RoomType
.
DIRECT_MESSAGE
,
user
=
SimpleUser
(
username
=
it
.
username
,
name
=
it
.
name
,
id
=
null
),
name
=
it
.
name
?:
""
,
fullName
=
it
.
name
,
readonly
=
false
,
updatedAt
=
null
,
timestamp
=
null
,
lastSeen
=
null
,
topic
=
null
,
description
=
null
,
announcement
=
null
,
default
=
false
,
open
=
false
,
alert
=
false
,
unread
=
0L
,
userMenstions
=
null
,
groupMentions
=
0L
,
lastMessage
=
null
,
client
=
client
)
}
}
private
suspend
fun
roomsToChatRooms
(
rooms
:
List
<
Room
>):
List
<
ChatRoom
>
{
return
rooms
.
map
{
ChatRoom
(
it
.
id
,
it
.
type
,
it
.
user
,
it
.
name
?:
""
,
it
.
fullName
,
it
.
readonly
,
it
.
updatedAt
,
null
,
null
,
it
.
topic
,
it
.
announcement
,
false
,
false
,
false
,
0L
,
null
,
0L
,
it
.
lastMessage
,
client
ChatRoom
(
id
=
it
.
id
,
type
=
it
.
type
,
user
=
it
.
user
,
name
=
it
.
name
?:
""
,
fullName
=
it
.
fullName
,
readonly
=
it
.
readonly
,
updatedAt
=
it
.
updatedAt
,
timestamp
=
null
,
lastSeen
=
null
,
topic
=
it
.
topic
,
description
=
it
.
description
,
announcement
=
it
.
announcement
,
default
=
false
,
open
=
false
,
alert
=
false
,
unread
=
0L
,
userMenstions
=
null
,
groupMentions
=
0L
,
lastMessage
=
it
.
lastMessage
,
client
=
client
)
}
}
...
...
@@ -255,6 +286,7 @@ class ChatRoomsPresenter @Inject constructor(private val view: ChatRoomsView,
timestamp
,
lastSeen
,
room
.
topic
,
room
.
description
,
room
.
announcement
,
default
,
open
,
...
...
@@ -286,6 +318,7 @@ class ChatRoomsPresenter @Inject constructor(private val view: ChatRoomsView,
subscription
.
timestamp
?:
timestamp
,
subscription
.
lastSeen
?:
lastSeen
,
topic
,
description
,
announcement
,
subscription
.
isDefault
,
subscription
.
open
,
...
...
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