Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-ios
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-ios
Commits
1dea47fc
Commit
1dea47fc
authored
3 years ago
by
Kateryna Kostiuk
Committed by
Kateryna Kostiuk
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
account: add proxy server settings
Change-Id: I9fc231907bf651d8adef6649e2c03e46d5031502
parent
61691b49
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Ring/Ring/Features/Me/Me/MeViewController.swift
+39
-0
39 additions, 0 deletions
Ring/Ring/Features/Me/Me/MeViewController.swift
Ring/Ring/Features/Me/Me/MeViewModel.swift
+19
-2
19 additions, 2 deletions
Ring/Ring/Features/Me/Me/MeViewModel.swift
with
58 additions
and
2 deletions
Ring/Ring/Features/Me/Me/MeViewController.swift
+
39
−
0
View file @
1dea47fc
...
@@ -512,6 +512,45 @@ class MeViewController: EditProfileViewController, StoryboardBased, ViewModelBas
...
@@ -512,6 +512,45 @@ class MeViewController: EditProfileViewController, StoryboardBased, ViewModelBas
})
})
.
disposed
(
by
:
cell
.
disposeBag
)
.
disposed
(
by
:
cell
.
disposeBag
)
return
cell
return
cell
case
.
proxy
:
let
cell
=
DisposableCell
(
style
:
.
value1
,
reuseIdentifier
:
self
.
sipAccountCredentialsCell
)
cell
.
backgroundColor
=
UIColor
.
jamiBackgroundColor
cell
.
selectionStyle
=
.
none
let
text
=
UITextField
()
text
.
autocorrectionType
=
.
no
text
.
font
=
UIFont
.
preferredFont
(
forTextStyle
:
.
callout
)
text
.
returnKeyType
=
.
done
text
.
text
=
self
.
viewModel
.
proxyAddress
.
value
text
.
sizeToFit
()
text
.
rx
.
controlEvent
(
.
editingDidEndOnExit
)
.
observe
(
on
:
MainScheduler
.
instance
)
.
subscribe
(
onNext
:
{
[
weak
self
]
_
in
guard
let
text
=
text
.
text
else
{
return
}
self
?
.
viewModel
.
changeProxy
(
proxyServer
:
text
)
})
.
disposed
(
by
:
cell
.
disposeBag
)
cell
.
textLabel
?
.
text
=
"Proxy server"
cell
.
textLabel
?
.
sizeToFit
()
cell
.
sizeToFit
()
cell
.
detailTextLabel
?
.
font
=
UIFont
.
preferredFont
(
forTextStyle
:
.
callout
)
cell
.
detailTextLabel
?
.
textColor
=
UIColor
.
clear
var
frame
=
CGRect
(
x
:
self
.
sipCredentialsMargin
,
y
:
0
,
width
:
self
.
view
.
frame
.
width
-
self
.
sipCredentialsMargin
,
height
:
cell
.
frame
.
height
)
if
self
.
view
.
frame
.
width
-
self
.
sipCredentialsMargin
<
text
.
frame
.
size
.
width
{
let
origin
=
CGPoint
(
x
:
10
,
y
:
cell
.
textLabel
!.
frame
.
size
.
height
+
25
)
let
size
=
text
.
frame
.
size
frame
.
origin
=
origin
frame
.
size
=
size
cell
.
detailTextLabel
?
.
text
=
self
.
viewModel
.
proxyAddress
.
value
}
else
{
cell
.
detailTextLabel
?
.
text
=
""
}
cell
.
detailTextLabel
?
.
sizeToFit
()
text
.
frame
=
frame
cell
.
contentView
.
addSubview
(
text
)
cell
.
sizeToFit
()
return
cell
case
.
sipUserName
(
let
value
):
case
.
sipUserName
(
let
value
):
let
cell
=
self
let
cell
=
self
.
configureSipCredentialsCell
(
cellType
:
.
sipUserName
(
value
:
value
),
.
configureSipCredentialsCell
(
cellType
:
.
sipUserName
(
value
:
value
),
...
...
This diff is collapsed.
Click to expand it.
Ring/Ring/Features/Me/Me/MeViewModel.swift
+
19
−
2
View file @
1dea47fc
...
@@ -51,6 +51,7 @@ enum SettingsSection: SectionModelType {
...
@@ -51,6 +51,7 @@ enum SettingsSection: SectionModelType {
case
jamiUserName
(
label
:
String
)
case
jamiUserName
(
label
:
String
)
case
notifications
case
notifications
case
sipUserName
(
value
:
String
)
case
sipUserName
(
value
:
String
)
case
proxy
case
sipPassword
(
value
:
String
)
case
sipPassword
(
value
:
String
)
case
sipServer
(
value
:
String
)
case
sipServer
(
value
:
String
)
case
port
(
value
:
String
)
case
port
(
value
:
String
)
...
@@ -261,8 +262,16 @@ class MeViewModel: ViewModel, Stateable {
...
@@ -261,8 +262,16 @@ class MeViewModel: ViewModel, Stateable {
}()
}()
lazy
var
otherJamiSettings
:
Observable
<
SettingsSection
>
=
{
lazy
var
otherJamiSettings
:
Observable
<
SettingsSection
>
=
{
var
proxyServer
=
""
if
let
account
=
self
.
accountService
.
currentAccount
,
let
details
=
account
.
details
{
proxyServer
=
details
.
get
(
withConfigKeyModel
:
ConfigKeyModel
.
init
(
withKey
:
ConfigKey
.
proxyServer
))
self
.
proxyAddress
.
accept
(
proxyServer
)
}
let
items
:
[
SettingsSection
.
SectionRow
]
=
[
.
peerDiscovery
,
let
items
:
[
SettingsSection
.
SectionRow
]
=
[
.
peerDiscovery
,
.
blockedList
,
.
blockedList
,
.
proxy
,
SettingsSection
.
SectionRow
.
accountState
(
state
:
self
.
accountStatus
),
.
accountState
(
state
:
self
.
accountStatus
),
.
enableAccount
,
.
enableAccount
,
.
changePassword
,
.
changePassword
,
...
@@ -504,7 +513,6 @@ class MeViewModel: ViewModel, Stateable {
...
@@ -504,7 +513,6 @@ class MeViewModel: ViewModel, Stateable {
self
.
showActionState
.
accept
(
.
hideLoading
)
self
.
showActionState
.
accept
(
.
hideLoading
)
return
return
}
}
self
.
nameService
self
.
nameService
.
registerNameObservable
(
withAccount
:
accountId
,
.
registerNameObservable
(
withAccount
:
accountId
,
password
:
password
,
password
:
password
,
...
@@ -825,6 +833,15 @@ class MeViewModel: ViewModel, Stateable {
...
@@ -825,6 +833,15 @@ class MeViewModel: ViewModel, Stateable {
self
.
accountService
.
enableTurn
(
enable
:
enable
,
accountId
:
account
.
id
)
self
.
accountService
.
enableTurn
(
enable
:
enable
,
accountId
:
account
.
id
)
turnEnabled
.
accept
(
enable
)
turnEnabled
.
accept
(
enable
)
}
}
let
proxyAddress
=
BehaviorRelay
<
String
>
(
value
:
""
)
func
changeProxy
(
proxyServer
:
String
)
{
guard
let
accountId
=
self
.
accountService
.
currentAccount
?
.
id
else
{
return
}
self
.
accountService
.
setProxyAddress
(
accountID
:
accountId
,
proxy
:
proxyServer
)
self
.
proxyAddress
.
accept
(
proxyServer
)
}
func
enableUpnp
(
enable
:
Bool
)
{
func
enableUpnp
(
enable
:
Bool
)
{
guard
self
.
upnpEnabled
.
value
!=
enable
,
guard
self
.
upnpEnabled
.
value
!=
enable
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment