Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added missing handler #479

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion ChatK!t/ChatSDK/CKFileMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

import Foundation
import ChatKit
import ChatSDK

public class CKFileMessage: CKDownloadableMessage {
Expand Down
14 changes: 7 additions & 7 deletions ChatK!t/ChatSDK/CKUser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ open class CKUser: User {
}

open func userLastOnline() -> Date? {
if let module = BChatSDK.lastOnline() {
if let date = module.lastOnline(for: user) {
return date
} else {
module.getLastOnline(for: user)
}
}
// if let module = BChatSDK.lastOnline() {
// if let date = module.lastOnline(for: user) {
// return date
// } else {
// module.getLastOnline(for: user)
// }
// }
return nil
}

Expand Down
5 changes: 3 additions & 2 deletions ChatK!t/ChatSDK/ChatKitModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ open class ChatKitIntegration: NSObject, ChatViewControllerDelegate, ChatModelDe
open func viewWillAppear() {
BChatSDK.ui().setLocalNotificationHandler({ [weak self] thread in
if let thread = thread {
var enable = BLocalNotificationHandler().showLocalNotification(thread)
let enable = BLocalNotificationHandler().showLocalNotification(thread)
if enable, let current = self?.thread, thread.entityID() != current.entityID() {
return true
}
Expand All @@ -433,7 +433,8 @@ open class ChatKitIntegration: NSObject, ChatViewControllerDelegate, ChatModelDe
open func viewDidAppear() {
if let thread = thread {
if thread.typeIs(bThreadFilterPublic) {
BChatSDK.thread().addUsers([BChatSDK.currentUser()], to: thread)
guard let currentUser = BChatSDK.currentUser() else { return }
BChatSDK.thread().addUsers([currentUser], to: thread)
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions ChatK!t/Core/ChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import AudioToolbox
// func add(message: Message)
//}

public protocol ChatViewControllerTypingDelegate: class {
public protocol ChatViewControllerTypingDelegate: AnyObject {
func didStartTyping()
func didStopTyping()
}

public protocol ChatViewControllerDelegate: class {
public protocol ChatViewControllerDelegate: AnyObject {
func viewDidLoad()
func viewWillAppear()
func viewDidAppear()
Expand Down Expand Up @@ -368,8 +368,8 @@ open class ChatViewController: UIViewController {
updateNavigationBar()
}

open func updateConnectionStatus(_ status: ConnectionStatus? = .none) {
if status == .none {
open func updateConnectionStatus(_ status: ConnectionStatus? = Optional.none) {
if status == Optional.none {
updateNavigationBar(reconnecting: false)
}
reconnectingView.update(status)
Expand Down
2 changes: 1 addition & 1 deletion ChatK!t/Core/Customization/Provider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ open class Provider {

open func makeBackground(blur: Bool = true, effect: UIBlurEffect? = nil) -> UIView {
if blur {
var background: UIVisualEffectView = UIVisualEffectView(effect: effect ?? UIBlurEffect(style: .systemThinMaterial))
let background: UIVisualEffectView = UIVisualEffectView(effect: effect ?? UIBlurEffect(style: .systemThinMaterial))
background.autoresizingMask = [.flexibleWidth, .flexibleHeight]
return background
} else {
Expand Down
2 changes: 1 addition & 1 deletion ChatK!t/Core/Entities/Reply.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public protocol Reply : class {
public protocol Reply : AnyObject {
func replyTitle() -> String?
func replyText() -> String?
func replyImageURL() -> URL?
Expand Down
2 changes: 1 addition & 1 deletion ChatK!t/Core/Entities/User.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public protocol User : class {
public protocol User : AnyObject {
func userId() -> String
func userName() -> String

Expand Down
2 changes: 1 addition & 1 deletion ChatK!t/Core/KeyboardOverlay/RecordKeyboardOverlay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ open class RecordKeyboardOverlay: UIView, KeyboardOverlay {

}

public protocol RecordViewDelegate: class {
public protocol RecordViewDelegate: AnyObject {
func send(audio: Data, duration: Int)
}

Expand Down
4 changes: 1 addition & 3 deletions ChatK!t/Core/Message/Content/FileMessageContent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
//

import Foundation
import ChatKit
import ChatSDK

open class FileMessageContent: DefaultDownloadableMessageContent, MessageProgressHelperDelegate {

Expand Down Expand Up @@ -64,7 +62,7 @@ open class FileMessageContent: DefaultDownloadableMessageContent, MessageProgres

}
} else {
let image = UIImage(named: imageName, in: Bundle(for: FileMessageContent.self), compatibleWith: nil)
image = UIImage(named: imageName, in: Bundle(for: FileMessageContent.self), compatibleWith: nil)
}
}
_view.imageView.image = image
Expand Down
1 change: 0 additions & 1 deletion ChatK!t/Core/Message/Content/FileMessageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import Foundation
import FFCircularProgressView
import ChatKit

open class FileMessageView: UIView {

Expand Down
2 changes: 1 addition & 1 deletion ChatK!t/Core/Message/Model/MessagesModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import RxSwift

public protocol ChatModelDelegate: class {
public protocol ChatModelDelegate: AnyObject {

var model: ChatModel? {
get set
Expand Down
2 changes: 1 addition & 1 deletion ChatK!t/Core/Message/View/MessagesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ extension MessagesView: UITableViewDelegate {
open func heightForIndexPath(_ indexPath: IndexPath) -> CGFloat {
var height: CGFloat?

var width = UIScreen.main.bounds.width
let width = UIScreen.main.bounds.width
// if frame.width > 0 {
// width = frame.width
// }
Expand Down
2 changes: 1 addition & 1 deletion ChatK!t/Core/Message/View/PMessagesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import RxSwift

public protocol PMessagesView: class {
public protocol PMessagesView: AnyObject {
func scrollToBottom(animated: Bool, force: Bool)
func apply(snapshot: NSDiffableDataSourceSnapshot<Section, AbstractMessage>, animated: Bool) -> Completable
func reload(messages: [AbstractMessage], animated: Bool) -> Completable
Expand Down
4 changes: 2 additions & 2 deletions ChatK!t/Core/Toolbar/ChatToolbar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

import Foundation

public protocol ChatToolbarDelegate: class {
public protocol ChatToolbarDelegate: AnyObject {
func selectedMessages() -> [AbstractMessage]
func clearSelection(_ updateView: Bool?, animated: Bool)
}

public protocol ChatToolbarActionsDelegate: class {
public protocol ChatToolbarActionsDelegate: AnyObject {
var toolbarActions: [ToolbarAction] {
get
}
Expand Down
4 changes: 2 additions & 2 deletions ChatK!t/Core/Utils/DownloadManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ open class DownloadManager {
}

open func localURL(for id: String, pathExtension: String? = nil) -> URL? {
var path = path.appendingPathComponent(id)
var path = self.path.appendingPathComponent(id)
if let ext = pathExtension {
path.appendPathExtension(ext)
}
Expand Down Expand Up @@ -268,7 +268,7 @@ open class DefaultDownloadManagerListener: DownloadManagerListener {
}

open func downloadProgressUpdated(_ id: String, pathExtension: String?, progress: Float) {
if var message = message(for: id) {
if let message = message(for: id) {
message.setDownloadProgress(progress)
}
}
Expand Down
4 changes: 2 additions & 2 deletions ChatK!t/Core/Views/ReconnectingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ open class ReconnectingView : UIView {

}

open func update(_ connStatus: ConnectionStatus? = .none) {
if connStatus != .none {
open func update(_ connStatus: ConnectionStatus? = Optional.none) {
if connStatus != Optional.none {
isHidden = false
if connStatus != status {

Expand Down
1 change: 1 addition & 0 deletions ChatSDKCore/Classes/Hooks/PHookHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@

#define bHookWillPushUser @"bHookWillPushUser"
#define bHookUserUpdated @"bHookUserUpdated"
#define bHookUserLastOnlineUpdated @"bHookUserLastOnlineUpdated"

#define bHookServerPingFailed @"bHookServerPingFailed"

Expand Down