Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Examples/YouTubeClone/ChatClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extension ChatClient {
components.messageListVC = YTLiveChatMessageListViewController.self
components.messageComposerVC = YTChatComposerViewController.self
components.messageComposerView = YTChatMessageComposerView.self
components.scrollToLatestMessageButton = YTScrollToLatestMessageButton.self
components.scrollToBottomButton = YTScrollToLatestMessageButton.self
components.sendButton = YTSendButton.self
components.inputMessageView = YTInputChatMessageView.self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import StreamChatUI
import UIKit

/// A button which appears at the bottom of the chat list when the user is not viewing the latest messages. Tapping on this button scrolls to the latest messages.
final class YTScrollToLatestMessageButton: ScrollToLatestMessageButton {
final class YTScrollToLatestMessageButton: ScrollToBottomButton {
override func setUpAppearance() {
// Customise the appearance to make it look like the YouTube scroll to bottom button
tintColor = .white
Expand Down
6 changes: 3 additions & 3 deletions Examples/YouTubeClone/YTLiveChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ final class YTLiveChatMessageListViewController: ChatMessageListVC {
override func setUpLayout() {
super.setUpLayout()
NSLayoutConstraint.activate([
scrollToLatestMessageButton.centerXAnchor.constraint(equalTo: view.layoutMarginsGuide.centerXAnchor),
scrollToLatestMessageButton.widthAnchor.constraint(equalToConstant: 30),
scrollToLatestMessageButton.heightAnchor.constraint(equalToConstant: 30)
scrollToBottomButton.centerXAnchor.constraint(equalTo: view.layoutMarginsGuide.centerXAnchor),
scrollToBottomButton.widthAnchor.constraint(equalToConstant: 30),
scrollToBottomButton.heightAnchor.constraint(equalToConstant: 30)
])

dateOverlayView.removeFromSuperview()
Expand Down
11 changes: 0 additions & 11 deletions Sources/StreamChat/APIClient/Endpoints/Payloads/RawJSON.swift
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,3 @@ extension RawJSON {
}
}
}

// MARK: Deprecations

public extension RawJSON {
@available(*, deprecated, message: "dictionaryValue property should be used instead.")
func dictionary(with value: RawJSON?, forKey key: String) -> RawJSON? {
guard case var .dictionary(content) = self else { return nil }
content[key] = value
return .dictionary(content)
}
}
13 changes: 0 additions & 13 deletions Sources/StreamChat/ChatClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -477,13 +477,6 @@ public class ChatClient: @unchecked Sendable {
authenticationRepository.setToken(token: token, completeTokenWaiters: true)
}

/// Disconnects the chat client from the chat servers. No further updates from the servers
/// are received.
@available(*, deprecated, message: "Use the asynchronous version of `disconnect` for increased safety")
public func disconnect() {
disconnect {}
}

/// Disconnects the chat client from the chat servers. No further updates from the servers
/// are received.
public func disconnect(completion: @escaping @MainActor() -> Void) {
Expand All @@ -506,12 +499,6 @@ public class ChatClient: @unchecked Sendable {
}
}
}

/// Disconnects the chat client from the chat servers and removes all the local data related.
@available(*, deprecated, message: "Use the asynchronous version of `logout` for increased safety")
public func logout() {
logout {}
}

/// Disconnects the chat client from the chat servers and removes all the local data related.
/// - Parameters:
Expand Down
14 changes: 0 additions & 14 deletions Sources/StreamChat/Config/ChatClientConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,6 @@ public struct ChatClientConfig: Sendable {
/// **Warning**: There should be at max 1 active client at the same time, else it can lead to undefined behavior.
public var isClientInActiveMode: Bool

/// If set to `true` the `ChatClient` will automatically establish a web-socket
/// connection to listen to the updates when `refreshToken` is called.
///
/// If set to `false` the connection won't be established automatically
/// but has to be initiated manually by calling `connect`.
///
/// Is `true` by default.
@available(
*,
deprecated,
message: "This flag has no effect anymore. The flow for setting and for connecting the user has been unified to the `connectUser` set of methods."
)
public var shouldConnectAutomatically = true

/// If set to `true`, the `ChatClient` will try to stay connected while app is backgrounded.
/// If set to `false`, websocket disconnects immediately when app is backgrounded.
///
Expand Down
10 changes: 0 additions & 10 deletions Sources/StreamChat/Config/Token.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@ public struct Token: Decodable, Equatable, ExpressibleByStringLiteral, Sendable
public let userId: UserId
public let expiration: Date?

@available(
*,
deprecated,

message: "It is not a good practice to check expiration client side since the user can change the device's time."
)
public var isExpired: Bool {
expiration.map { $0 < Date() } ?? false
}

/// Created a new `Token` instance.
/// - Parameter value: The JWT string value. It must be in valid format and contain `user_id` in payload.
public init(stringLiteral value: StringLiteralType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2101,80 +2101,6 @@ extension ClientError {
final class ChannelFeatureDisabled: ClientError, @unchecked Sendable {}
}

// MARK: - Deprecations

public extension ChatChannelController {
/// Indicates whether the channel has typing events enabled.
@available(*, deprecated, message: "`channel.canSendTypingEvents` should be used instead.")
var areTypingEventsEnabled: Bool {
channel?.canSendTypingEvents == true
}

/// Indicates whether the channel has reactions enabled.
@available(*, deprecated, message: "`channel.canSendReaction` should be used instead.")
var areReactionsEnabled: Bool {
channel?.canSendReaction == true
}

/// Indicates whether the channel has replies enabled.
@available(*, deprecated, message: "`channel.canSendReply` should be used instead.")
var areRepliesEnabled: Bool {
channel?.canSendReply == true
}

/// Indicates whether the channel has quotes enabled.
@available(*, deprecated, message: "`channel.canQuoteMessage` should be used instead.")
var areQuotesEnabled: Bool {
channel?.canQuoteMessage == true
}

/// Indicates whether the channel has read events enabled.
@available(*, deprecated, message: "`channel.canReceiveReadEvents` should be used instead.")
var areReadEventsEnabled: Bool {
channel?.canReceiveReadEvents == true
}

/// Indicates whether the channel supports uploading files/images.
@available(*, deprecated, message: "`channel.canUploadFile should be used instead.")
var areUploadsEnabled: Bool {
channel?.canUploadFile == true
}
}

public extension ChatChannelController {
/// Uploads the given file to CDN and returns the file URL.
/// - Parameters:
/// - localFileURL: Local URL of the file.
/// - progress: Upload progress callback
/// - completion: Completion to be called when upload finishes, or errors.
@available(*, deprecated, message: "use uploadAttachment() instead.")
func uploadFile(
localFileURL: URL,
progress: (@Sendable(Double) -> Void)? = nil,
completion: @escaping @MainActor(Result<URL, Error>) -> Void
) {
uploadAttachment(localFileURL: localFileURL, type: .file, progress: progress) { result in
completion(result.map(\.remoteURL))
}
}

/// Uploads the given image to CDN and returns the file URL.
/// - Parameters:
/// - localFileURL: Local URL of the image.
/// - progress: Upload progress callback
/// - completion: Completion to be called when upload finishes, or errors.
@available(*, deprecated, message: "use uploadAttachment() instead.")
func uploadImage(
localFileURL: URL,
progress: (@Sendable(Double) -> Void)? = nil,
completion: @escaping @MainActor(Result<URL, Error>) -> Void
) {
uploadAttachment(localFileURL: localFileURL, type: .image, progress: progress) { result in
completion(result.map(\.remoteURL))
}
}
}

public extension ChatChannel {
func lastReadMessageId(userId: UserId) -> MessageId? {
guard let currentUserRead = reads.first(where: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,6 @@ public class ChatChannelListController: DataController, DelegateCallable, DataSt
}
}

@available(*, deprecated, message: "Please use `markAllRead` available in `CurrentChatUserController`")
public func markAllRead(completion: (@MainActor(Error?) -> Void)? = nil) {
worker.markAllRead { error in
self.callback {
completion?(error)
}
}
}

// MARK: - Internal

func refreshLoadedChannels(completion: @escaping @Sendable(Result<Set<ChannelId>, Error>) -> Void) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -754,16 +754,3 @@ public extension CurrentChatUserController {
set { multicastDelegate.set(mainDelegate: newValue) }
}
}

// MARK: - Deprecations

public extension CurrentChatUserController {
@available(
*,
deprecated,
message: "use addDevice(_pushDevice:) instead. This deprecated function doesn't correctly support multiple push providers."
)
func addDevice(token: Data, pushProvider: PushProvider = .apn, completion: (@Sendable(Error?) -> Void)? = nil) {
addDevice(.apn(token: token), completion: completion)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ public class ChatUserSearchController: DataController, DelegateCallable, DataSto
return _users
}

@available(*, deprecated, message: "Please, switch to `userArray: [ChatUser]`")
public var users: LazyCachedMapCollection<ChatUser> {
.init(source: userArray, map: { $0 }, context: nil)
}

lazy var userQueryUpdater = self.environment
.userQueryUpdaterBuilder(
client.databaseContainer,
Expand Down
Loading
Loading