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
e24c8728
Unverified
Commit
e24c8728
authored
Jul 27, 2018
by
Lucio Maciel
Committed by
GitHub
Jul 27, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'beta' into fix/notifications-not-cleared
parents
e5666a46
d48a729d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
11 deletions
+16
-11
LoginDeepLinkInfo.kt
.../android/authentication/domain/model/LoginDeepLinkInfo.kt
+2
-2
LoginPresenter.kt
...droid/authentication/login/presentation/LoginPresenter.kt
+9
-4
ServerFragment.kt
...rocket/android/authentication/server/ui/ServerFragment.kt
+4
-2
AuthenticationActivity.kt
...ocket/android/authentication/ui/AuthenticationActivity.kt
+1
-3
No files found.
app/src/main/java/chat/rocket/android/authentication/domain/model/LoginDeepLinkInfo.kt
View file @
e24c8728
...
@@ -11,8 +11,8 @@ import timber.log.Timber
...
@@ -11,8 +11,8 @@ import timber.log.Timber
@Parcelize
@Parcelize
data class
LoginDeepLinkInfo
(
data class
LoginDeepLinkInfo
(
val
url
:
String
,
val
url
:
String
,
val
userId
:
String
,
val
userId
:
String
?
,
val
token
:
String
val
token
:
String
?
)
:
Parcelable
)
:
Parcelable
fun
Intent
.
getLoginDeepLinkInfo
():
LoginDeepLinkInfo
?
{
fun
Intent
.
getLoginDeepLinkInfo
():
LoginDeepLinkInfo
?
{
...
...
app/src/main/java/chat/rocket/android/authentication/login/presentation/LoginPresenter.kt
View file @
e24c8728
...
@@ -141,10 +141,15 @@ class LoginPresenter @Inject constructor(
...
@@ -141,10 +141,15 @@ class LoginPresenter @Inject constructor(
fun
authenticateWithDeepLink
(
deepLinkInfo
:
LoginDeepLinkInfo
)
{
fun
authenticateWithDeepLink
(
deepLinkInfo
:
LoginDeepLinkInfo
)
{
val
serverUrl
=
deepLinkInfo
.
url
val
serverUrl
=
deepLinkInfo
.
url
setupConnectionInfo
(
serverUrl
)
setupConnectionInfo
(
serverUrl
)
if
(
deepLinkInfo
.
userId
!=
null
&&
deepLinkInfo
.
token
!=
null
)
{
deepLinkUserId
=
deepLinkInfo
.
userId
deepLinkUserId
=
deepLinkInfo
.
userId
deepLinkToken
=
deepLinkInfo
.
token
deepLinkToken
=
deepLinkInfo
.
token
tokenRepository
.
save
(
serverUrl
,
Token
(
deepLinkUserId
,
deepLinkToken
))
tokenRepository
.
save
(
serverUrl
,
Token
(
deepLinkUserId
,
deepLinkToken
))
doAuthentication
(
TYPE_LOGIN_DEEP_LINK
)
doAuthentication
(
TYPE_LOGIN_DEEP_LINK
)
}
else
{
// If we don't have the login credentials, just go through normal setup and user input.
setupView
()
}
}
}
private
fun
setupConnectionInfo
(
serverUrl
:
String
)
{
private
fun
setupConnectionInfo
(
serverUrl
:
String
)
{
...
...
app/src/main/java/chat/rocket/android/authentication/server/ui/ServerFragment.kt
View file @
e24c8728
...
@@ -104,6 +104,8 @@ class ServerFragment : Fragment(), ServerView {
...
@@ -104,6 +104,8 @@ class ServerFragment : Fragment(), ServerView {
override
fun
onDestroyView
()
{
override
fun
onDestroyView
()
{
super
.
onDestroyView
()
super
.
onDestroyView
()
// reset deep link info, so user can come back and log to another server...
deepLinkInfo
=
null
relative_layout
.
viewTreeObserver
.
removeOnGlobalLayoutListener
(
layoutListener
)
relative_layout
.
viewTreeObserver
.
removeOnGlobalLayoutListener
(
layoutListener
)
}
}
...
@@ -144,9 +146,9 @@ class ServerFragment : Fragment(), ServerView {
...
@@ -144,9 +146,9 @@ class ServerFragment : Fragment(), ServerView {
hideLoading
()
hideLoading
()
AlertDialog
.
Builder
(
it
)
AlertDialog
.
Builder
(
it
)
.
setMessage
(
getString
(
R
.
string
.
msg_ver_not_recommended
,
BuildConfig
.
RECOMMENDED_SERVER_VERSION
))
.
setMessage
(
getString
(
R
.
string
.
msg_ver_not_recommended
,
BuildConfig
.
RECOMMENDED_SERVER_VERSION
))
.
setPositiveButton
(
R
.
string
.
msg_ok
,
{
_
,
_
->
.
setPositiveButton
(
R
.
string
.
msg_ok
)
{
_
,
_
->
performConnect
()
performConnect
()
}
)
}
.
create
()
.
create
()
.
show
()
.
show
()
}
}
...
...
app/src/main/java/chat/rocket/android/authentication/ui/AuthenticationActivity.kt
View file @
e24c8728
...
@@ -56,9 +56,7 @@ class AuthenticationActivity : AppCompatActivity(), HasSupportFragmentInjector {
...
@@ -56,9 +56,7 @@ class AuthenticationActivity : AppCompatActivity(), HasSupportFragmentInjector {
override
fun
onActivityResult
(
requestCode
:
Int
,
resultCode
:
Int
,
data
:
Intent
?)
{
override
fun
onActivityResult
(
requestCode
:
Int
,
resultCode
:
Int
,
data
:
Intent
?)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
)
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
)
val
currentFragment
=
supportFragmentManager
.
findFragmentById
(
R
.
id
.
fragment_container
)
val
currentFragment
=
supportFragmentManager
.
findFragmentById
(
R
.
id
.
fragment_container
)
if
(
currentFragment
!=
null
)
{
currentFragment
?.
onActivityResult
(
requestCode
,
resultCode
,
data
)
currentFragment
.
onActivityResult
(
requestCode
,
resultCode
,
data
)
}
}
}
override
fun
supportFragmentInjector
():
AndroidInjector
<
Fragment
>
{
override
fun
supportFragmentInjector
():
AndroidInjector
<
Fragment
>
{
...
...
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