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
f00301c0
Commit
f00301c0
authored
Feb 02, 2018
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes check for nullability in variables.
parent
6988897c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
26 deletions
+9
-26
LoginPresenter.kt
...droid/authentication/login/presentation/LoginPresenter.kt
+3
-7
TwoFAPresenter.kt
...d/authentication/twofactor/presentation/TwoFAPresenter.kt
+3
-7
ChatRoomsFragment.kt
...ava/chat/rocket/android/chatrooms/ui/ChatRoomsFragment.kt
+1
-4
ProfilePresenter.kt
...t/rocket/android/profile/presentation/ProfilePresenter.kt
+2
-8
No files found.
app/src/main/java/chat/rocket/android/authentication/login/presentation/LoginPresenter.kt
View file @
f00301c0
...
...
@@ -93,13 +93,9 @@ class LoginPresenter @Inject constructor(private val view: LoginView,
try
{
val
token
=
client
.
login
(
usernameOrEmail
,
password
)
if
(
token
!=
null
)
{
multiServerRepository
.
save
(
server
,
TokenModel
(
token
.
userId
,
token
.
authToken
))
registerPushToken
()
navigator
.
toChatList
()
}
else
{
view
.
showGenericErrorMessage
()
}
}
catch
(
exception
:
RocketChatException
)
{
when
(
exception
)
{
is
RocketChatTwoFactorException
->
{
...
...
app/src/main/java/chat/rocket/android/authentication/twofactor/presentation/TwoFAPresenter.kt
View file @
f00301c0
...
...
@@ -44,13 +44,9 @@ class TwoFAPresenter @Inject constructor(private val view: TwoFAView,
try
{
// The token is saved via the client TokenProvider
val
token
=
client
.
login
(
usernameOrEmail
,
password
,
twoFactorAuthenticationCode
)
if
(
token
!=
null
)
{
multiServerRepository
.
save
(
server
,
TokenModel
(
token
.
userId
,
token
.
authToken
))
registerPushToken
()
navigator
.
toChatList
()
}
else
{
view
.
showGenericErrorMessage
()
}
}
catch
(
exception
:
RocketChatException
)
{
if
(
exception
is
RocketChatAuthException
)
{
view
.
alertInvalidTwoFactorAuthenticationCode
()
...
...
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsFragment.kt
View file @
f00301c0
...
...
@@ -15,7 +15,6 @@ import chat.rocket.android.authentication.ui.AuthenticationActivity
import
chat.rocket.android.chatrooms.presentation.ChatRoomsPresenter
import
chat.rocket.android.chatrooms.presentation.ChatRoomsView
import
chat.rocket.android.util.inflate
import
chat.rocket.android.util.setVisibility
import
chat.rocket.android.util.setVisible
import
chat.rocket.android.widget.DividerItemDecoration
import
chat.rocket.core.model.ChatRoom
...
...
@@ -94,9 +93,7 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
}
}
override
fun
showNoChatRoomsToDisplay
()
=
text_no_data_to_display
.
setVisibility
(
true
)
override
fun
showLoading
()
=
view_loading
.
setVisibility
(
true
)
override
fun
showNoChatRoomsToDisplay
()
=
text_no_data_to_display
.
setVisible
(
true
)
override
fun
showLoading
()
=
view_loading
.
setVisible
(
true
)
...
...
app/src/main/java/chat/rocket/android/profile/presentation/ProfilePresenter.kt
View file @
f00301c0
...
...
@@ -10,7 +10,6 @@ import chat.rocket.common.util.ifNull
import
chat.rocket.core.RocketChatClient
import
chat.rocket.core.internal.rest.me
import
chat.rocket.core.internal.rest.updateProfile
import
timber.log.Timber
import
javax.inject.Inject
class
ProfilePresenter
@Inject
constructor
(
private
val
view
:
ProfileView
,
...
...
@@ -46,13 +45,8 @@ class ProfilePresenter @Inject constructor (private val view: ProfileView,
view
.
showLoading
()
try
{
val
user
=
client
.
updateProfile
(
myselfId
,
email
,
name
,
username
)
if
(
user
!=
null
)
{
view
.
showProfileUpdateSuccessfullyMessage
()
val
avatarUrl
=
UrlHelper
.
getAvatarUrl
(
serverUrl
,
user
.
username
!!
)
view
.
showProfile
(
avatarUrl
,
user
.
name
!!
,
user
.
username
!!
,
user
.
emails
?.
get
(
0
)
?.
address
!!
)
}
else
{
view
.
showGenericErrorMessage
()
}
loadUserProfile
()
}
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