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
789ddbb4
Commit
789ddbb4
authored
Nov 21, 2018
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the username not being displayed.
parent
689cffce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
23 deletions
+21
-23
MainActivity.kt
...src/main/java/chat/rocket/android/main/ui/MainActivity.kt
+0
-3
ProfilePresenter.kt
...t/rocket/android/profile/presentation/ProfilePresenter.kt
+21
-20
No files found.
app/src/main/java/chat/rocket/android/main/ui/MainActivity.kt
View file @
789ddbb4
...
...
@@ -62,10 +62,7 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector,
setContentView
(
R
.
layout
.
activity_main
)
refreshPushToken
()
chatRoomId
=
intent
.
getStringExtra
(
INTENT_CHAT_ROOM_ID
)
println
(
"ChatRoomId: $chatRoomId"
)
presenter
.
clearNotificationsForChatroom
(
chatRoomId
)
presenter
.
connect
()
...
...
app/src/main/java/chat/rocket/android/profile/presentation/ProfilePresenter.kt
View file @
789ddbb4
...
...
@@ -29,7 +29,6 @@ import chat.rocket.core.internal.rest.setAvatar
import
chat.rocket.core.internal.rest.updateProfile
import
kotlinx.coroutines.experimental.DefaultDispatcher
import
kotlinx.coroutines.experimental.withContext
import
java.lang.Exception
import
java.util.*
import
javax.inject.Inject
...
...
@@ -58,20 +57,17 @@ class ProfilePresenter @Inject constructor(
)
{
private
val
serverUrl
=
serverInteractor
.
get
()
!!
private
val
client
:
RocketChatClient
=
factory
.
create
(
serverUrl
)
private
val
myselfId
=
userHelper
.
user
()
?.
id
?:
""
private
var
myselfName
=
userHelper
.
user
()
?.
name
?:
""
private
var
myselfUsername
=
userHelper
.
username
()
?:
""
private
var
myselfEmailAddress
=
userHelper
.
user
()
?.
emails
?.
getOrNull
(
0
)
?.
address
?:
""
private
val
user
=
userHelper
.
user
()
fun
loadUserProfile
()
{
launchUI
(
strategy
)
{
view
.
showLoading
()
try
{
view
.
showProfile
(
serverUrl
.
avatarUrl
(
myselfUsername
),
myselfName
,
myselfUsername
,
myselfEmailAddress
serverUrl
.
avatarUrl
(
user
?.
username
?:
""
),
user
?.
name
?:
""
,
user
?.
username
?:
""
,
user
?.
emails
?.
getOrNull
(
0
)
?.
address
?:
""
)
}
catch
(
exception
:
RocketChatException
)
{
view
.
showMessage
(
exception
)
...
...
@@ -85,14 +81,16 @@ class ProfilePresenter @Inject constructor(
launchUI
(
strategy
)
{
view
.
showLoading
()
try
{
retryIO
{
client
.
updateProfile
(
myselfId
,
email
,
name
,
username
)
}
myselfEmailAddress
=
email
myselfName
=
name
myselfUsername
=
username
user
?.
id
?.
let
{
id
->
retryIO
{
client
.
updateProfile
(
id
,
email
,
name
,
username
)
}
}
view
.
showProfileUpdateSuccessfullyMessage
()
loadUserProfile
()
view
.
showProfile
(
serverUrl
.
avatarUrl
(
user
?.
username
?:
""
),
name
,
username
,
email
)
}
catch
(
exception
:
RocketChatException
)
{
exception
.
message
?.
let
{
view
.
showMessage
(
it
)
...
...
@@ -117,7 +115,7 @@ class ProfilePresenter @Inject constructor(
uriInteractor
.
getInputStream
(
uri
)
}
}
view
.
reloadUserAvatar
(
serverUrl
.
avatarUrl
(
myselfUsername
))
user
?.
username
?.
let
{
view
.
reloadUserAvatar
(
it
)
}
}
catch
(
exception
:
RocketChatException
)
{
exception
.
message
?.
let
{
view
.
showMessage
(
it
)
...
...
@@ -144,7 +142,8 @@ class ProfilePresenter @Inject constructor(
byteArray
?.
inputStream
()
}
}
view
.
reloadUserAvatar
(
serverUrl
.
avatarUrl
(
myselfUsername
))
user
?.
username
?.
let
{
view
.
reloadUserAvatar
(
it
)
}
}
catch
(
exception
:
RocketChatException
)
{
exception
.
message
?.
let
{
view
.
showMessage
(
it
)
...
...
@@ -161,8 +160,10 @@ class ProfilePresenter @Inject constructor(
launchUI
(
strategy
)
{
view
.
showLoading
()
try
{
retryIO
{
client
.
resetAvatar
(
myselfId
)
}
view
.
reloadUserAvatar
(
serverUrl
.
avatarUrl
(
myselfUsername
))
user
?.
id
?.
let
{
id
->
retryIO
{
client
.
resetAvatar
(
id
)
}
}
user
?.
username
?.
let
{
view
.
reloadUserAvatar
(
it
)
}
}
catch
(
exception
:
RocketChatException
)
{
exception
.
message
?.
let
{
view
.
showMessage
(
it
)
...
...
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