mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
720 B
Swift
33 lines
720 B
Swift
7 years ago
|
//
|
||
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||
|
//
|
||
9 years ago
|
|
||
|
import Foundation
|
||
|
|
||
|
struct TurnServerInfo {
|
||
|
|
||
|
let password: String
|
||
|
let username: String
|
||
|
let urls: [String]
|
||
|
|
||
|
init?(attributes: [String: AnyObject]) {
|
||
|
if let passwordAttribute = (attributes["password"] as? String) {
|
||
|
password = passwordAttribute
|
||
|
} else {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
if let usernameAttribute = attributes["username"] as? String {
|
||
|
username = usernameAttribute
|
||
|
} else {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
if let urlsAttribute = attributes["urls"] as? [String] {
|
||
|
urls = urlsAttribute
|
||
|
} else {
|
||
|
return nil
|
||
|
}
|
||
|
}
|
||
|
}
|