Skip to content

Commit 3314dac

Browse files
committed
Address comments: move 'presence' and 'private' channel types to correct enum.
1 parent 970eebf commit 3314dac

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sources/Constants.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ public enum Constants {
99
}
1010

1111
enum ChannelTypes {
12+
static let presence = "presence"
13+
static let `private` = "private"
1214
static let privateEncrypted = "private-encrypted"
1315
}
1416

@@ -33,8 +35,6 @@ public enum Constants {
3335
static let client = "client"
3436
static let pusher = "pusher"
3537
static let pusherInternal = "pusher_internal"
36-
static let presence = "presence"
37-
static let `private` = "private"
3838
}
3939

4040
enum JSONKeys {

Sources/PusherChannel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ public enum PusherChannelType {
1010
}
1111

1212
public static func type(forName name: String) -> PusherChannelType {
13-
if (name.components(separatedBy: "-")[0] == Constants.EventTypes.presence) {
13+
if (name.components(separatedBy: "-")[0] == Constants.ChannelTypes.presence) {
1414
return .presence
15-
} else if (name.components(separatedBy: "-")[0] == Constants.EventTypes.private) {
15+
} else if (name.components(separatedBy: "-")[0] == Constants.ChannelTypes.private) {
1616
return .private
1717
} else {
1818
return .normal

0 commit comments

Comments
 (0)