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
37c2f375
Commit
37c2f375
authored
Apr 17, 2018
by
Lucio Maciel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix missing email crash on ProfileFragment
parent
7b7997d5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
ProfilePresenter.kt
...t/rocket/android/profile/presentation/ProfilePresenter.kt
+2
-1
ProfileView.kt
...a/chat/rocket/android/profile/presentation/ProfileView.kt
+1
-2
ProfileFragment.kt
...in/java/chat/rocket/android/profile/ui/ProfileFragment.kt
+3
-3
No files found.
app/src/main/java/chat/rocket/android/profile/presentation/ProfilePresenter.kt
View file @
37c2f375
...
...
@@ -30,11 +30,12 @@ class ProfilePresenter @Inject constructor(private val view: ProfileView,
val
myself
=
retryIO
(
"me"
)
{
client
.
me
()
}
myselfId
=
myself
.
id
!!
val
avatarUrl
=
serverUrl
.
avatarUrl
(
myself
.
username
!!
)
val
email
=
myself
.
emails
?.
getOrNull
(
0
)
?.
address
view
.
showProfile
(
avatarUrl
,
myself
.
name
?:
""
,
myself
.
username
?:
""
,
myself
.
emails
?.
get
(
0
)
?.
address
!!
email
)
}
catch
(
exception
:
RocketChatException
)
{
view
.
showMessage
(
exception
)
...
...
app/src/main/java/chat/rocket/android/profile/presentation/ProfileView.kt
View file @
37c2f375
...
...
@@ -2,7 +2,6 @@ package chat.rocket.android.profile.presentation
import
chat.rocket.android.core.behaviours.LoadingView
import
chat.rocket.android.core.behaviours.MessageView
import
chat.rocket.core.model.Myself
interface
ProfileView
:
LoadingView
,
MessageView
{
...
...
@@ -14,7 +13,7 @@ interface ProfileView : LoadingView, MessageView {
* @param username The user username.
* @param email The user email.
*/
fun
showProfile
(
avatarUrl
:
String
,
name
:
String
,
username
:
String
,
email
:
String
)
fun
showProfile
(
avatarUrl
:
String
,
name
:
String
,
username
:
String
,
email
:
String
?
)
/**
* Shows a profile update successfully message
...
...
app/src/main/java/chat/rocket/android/profile/ui/ProfileFragment.kt
View file @
37c2f375
...
...
@@ -55,18 +55,18 @@ class ProfileFragment : Fragment(), ProfileView, ActionMode.Callback {
super
.
onDestroyView
()
}
override
fun
showProfile
(
avatarUrl
:
String
,
name
:
String
,
username
:
String
,
email
:
String
)
{
override
fun
showProfile
(
avatarUrl
:
String
,
name
:
String
,
username
:
String
,
email
:
String
?
)
{
ui
{
image_avatar
.
setImageURI
(
avatarUrl
)
text_name
.
textContent
=
name
text_username
.
textContent
=
username
text_email
.
textContent
=
email
text_email
.
textContent
=
email
?:
""
text_avatar_url
.
textContent
=
""
currentName
=
name
currentUsername
=
username
currentEmail
=
email
currentEmail
=
email
?:
""
currentAvatar
=
avatarUrl
profile_container
.
setVisible
(
true
)
...
...
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