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
149fb862
Commit
149fb862
authored
Apr 18, 2018
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove version check from login screen since we are doing it on server screen; fix typo
parent
0488863a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
LoginPresenter.kt
...droid/authentication/login/presentation/LoginPresenter.kt
+14
-14
LoginFragment.kt
...t/rocket/android/authentication/login/ui/LoginFragment.kt
+1
-1
AuthenticationActivity.kt
...ocket/android/authentication/ui/AuthenticationActivity.kt
+1
-1
No files found.
app/src/main/java/chat/rocket/android/authentication/login/presentation/LoginPresenter.kt
View file @
149fb862
...
@@ -32,17 +32,18 @@ private const val SERVICE_NAME_GOOGLE = "google"
...
@@ -32,17 +32,18 @@ private const val SERVICE_NAME_GOOGLE = "google"
private
const
val
SERVICE_NAME_LINKEDIN
=
"linkedin"
private
const
val
SERVICE_NAME_LINKEDIN
=
"linkedin"
private
const
val
SERVICE_NAME_GILAB
=
"gitlab"
private
const
val
SERVICE_NAME_GILAB
=
"gitlab"
class
LoginPresenter
@Inject
constructor
(
private
val
view
:
LoginView
,
class
LoginPresenter
@Inject
constructor
(
private
val
strategy
:
CancelStrategy
,
private
val
view
:
LoginView
,
private
val
navigator
:
AuthenticationNavigator
,
private
val
strategy
:
CancelStrategy
,
private
val
tokenRepository
:
TokenRepository
,
private
val
navigator
:
AuthenticationNavigator
,
private
val
localRepository
:
LocalRepository
,
private
val
tokenRepository
:
TokenRepository
,
private
val
getAccountsInteractor
:
GetAccountsInteractor
,
private
val
localRepository
:
LocalRepository
,
private
val
settingsInteractor
:
GetSettingsInteractor
,
private
val
getAccountsInteractor
:
GetAccountsInteractor
,
serverInteractor
:
GetCurrentServerInteractor
,
private
val
settingsInteractor
:
GetSettingsInteractor
,
private
val
saveAccountInteractor
:
SaveAccountInteractor
,
serverInteractor
:
GetCurrentServerInteractor
,
private
val
factory
:
RocketChatClientFactory
)
private
val
saveAccountInteractor
:
SaveAccountInteractor
,
:
CheckServerPresenter
(
strategy
,
factory
,
view
)
{
private
val
factory
:
RocketChatClientFactory
)
:
CheckServerPresenter
(
strategy
,
factory
,
view
)
{
// TODO - we should validate the current server when opening the app, and have a nonnull get()
// TODO - we should validate the current server when opening the app, and have a nonnull get()
private
val
currentServer
=
serverInteractor
.
get
()
!!
private
val
currentServer
=
serverInteractor
.
get
()
!!
private
lateinit
var
client
:
RocketChatClient
private
lateinit
var
client
:
RocketChatClient
...
@@ -62,7 +63,6 @@ class LoginPresenter @Inject constructor(private val view: LoginView,
...
@@ -62,7 +63,6 @@ class LoginPresenter @Inject constructor(private val view: LoginView,
setupUserRegistrationView
()
setupUserRegistrationView
()
setupCasView
()
setupCasView
()
setupOauthServicesView
()
setupOauthServicesView
()
checkServerInfo
(
currentServer
)
}
}
fun
authenticateWithUserAndPassword
(
usernameOrEmail
:
String
,
password
:
String
)
{
fun
authenticateWithUserAndPassword
(
usernameOrEmail
:
String
,
password
:
String
)
{
...
@@ -92,7 +92,7 @@ class LoginPresenter @Inject constructor(private val view: LoginView,
...
@@ -92,7 +92,7 @@ class LoginPresenter @Inject constructor(private val view: LoginView,
doAuthentication
(
TYPE_LOGIN_OAUTH
)
doAuthentication
(
TYPE_LOGIN_OAUTH
)
}
}
fun
authentica
d
eWithDeepLink
(
deepLinkInfo
:
LoginDeepLinkInfo
)
{
fun
authentica
t
eWithDeepLink
(
deepLinkInfo
:
LoginDeepLinkInfo
)
{
val
serverUrl
=
deepLinkInfo
.
url
val
serverUrl
=
deepLinkInfo
.
url
setupConnectionInfo
(
serverUrl
)
setupConnectionInfo
(
serverUrl
)
deepLinkUserId
=
deepLinkInfo
.
userId
deepLinkUserId
=
deepLinkInfo
.
userId
...
@@ -291,7 +291,7 @@ class LoginPresenter @Inject constructor(private val view: LoginView,
...
@@ -291,7 +291,7 @@ class LoginPresenter @Inject constructor(private val view: LoginView,
private
fun
getOauthClientId
(
listMap
:
List
<
Map
<
String
,
String
>>,
serviceName
:
String
):
String
?
{
private
fun
getOauthClientId
(
listMap
:
List
<
Map
<
String
,
String
>>,
serviceName
:
String
):
String
?
{
return
listMap
.
find
{
map
->
map
.
containsValue
(
serviceName
)
}
return
listMap
.
find
{
map
->
map
.
containsValue
(
serviceName
)
}
?.
get
(
"appId"
)
?.
get
(
"appId"
)
}
}
private
suspend
fun
saveAccount
(
username
:
String
)
{
private
suspend
fun
saveAccount
(
username
:
String
)
{
...
...
app/src/main/java/chat/rocket/android/authentication/login/ui/LoginFragment.kt
View file @
149fb862
...
@@ -72,7 +72,7 @@ class LoginFragment : Fragment(), LoginView {
...
@@ -72,7 +72,7 @@ class LoginFragment : Fragment(), LoginView {
}
}
deepLinkInfo
?.
let
{
deepLinkInfo
?.
let
{
presenter
.
authentica
d
eWithDeepLink
(
it
)
presenter
.
authentica
t
eWithDeepLink
(
it
)
}.
ifNull
{
}.
ifNull
{
presenter
.
setupView
()
presenter
.
setupView
()
}
}
...
...
app/src/main/java/chat/rocket/android/authentication/ui/AuthenticationActivity.kt
View file @
149fb862
...
@@ -34,7 +34,7 @@ class AuthenticationActivity : AppCompatActivity(), HasSupportFragmentInjector {
...
@@ -34,7 +34,7 @@ class AuthenticationActivity : AppCompatActivity(), HasSupportFragmentInjector {
val
deepLinkInfo
=
intent
.
getLoginDeepLinkInfo
()
val
deepLinkInfo
=
intent
.
getLoginDeepLinkInfo
()
launch
(
UI
+
job
)
{
launch
(
UI
+
job
)
{
val
newServer
=
intent
.
getBooleanExtra
(
INTENT_ADD_NEW_SERVER
,
false
)
val
newServer
=
intent
.
getBooleanExtra
(
INTENT_ADD_NEW_SERVER
,
false
)
// if we got authentica
d
eWithDeepLink information, pass true to newServer also
// if we got authentica
t
eWithDeepLink information, pass true to newServer also
presenter
.
loadCredentials
(
newServer
||
deepLinkInfo
!=
null
)
{
authenticated
->
presenter
.
loadCredentials
(
newServer
||
deepLinkInfo
!=
null
)
{
authenticated
->
if
(!
authenticated
)
{
if
(!
authenticated
)
{
showServerInput
(
savedInstanceState
,
deepLinkInfo
)
showServerInput
(
savedInstanceState
,
deepLinkInfo
)
...
...
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