Skip to content

Commit a402b11

Browse files
authored
Merge pull request #39 from zjc19891106/main
4.12.0
2 parents 583d9c5 + 19114cf commit a402b11

File tree

5 files changed

+13
-31
lines changed

5 files changed

+13
-31
lines changed

EaseChatUIKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'EaseChatUIKit'
11-
s.version = '4.11.2'
11+
s.version = '4.12.0'
1212
s.summary = 'A easy for use ChatUIKit.'
1313

1414
# This description is used to generate tags and improve search results.

Sources/EaseChatUIKit/Classes/UI/Components/Chat/Controllers/ForwardTargetViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ extension ForwardTargetViewController: UITableViewDelegate,UITableViewDataSource
264264
cell.refresh(info: profile, keyword: self.searchKeyWord, forward: .forwarded)
265265
}
266266
} else {
267+
self.showToast(toast: error?.errorDescription ?? "Failed to forward message")
267268
consoleLogInfo("ForwardTargetViewController forwardMessages error:\(error?.errorDescription ?? "")", type: .error)
268269
}
269270
})

Sources/EaseChatUIKit/Classes/UI/Components/Chat/Controllers/MessageListController.swift

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ import AVFoundation
139139
}
140140
self.navigation.title = nickname
141141
self.navigation.avatarURL = info.avatarURL
142+
self.processFollowInputAttachmentAction()
142143
}
143144

144145
open override func viewWillDisappear(_ animated: Bool) {
@@ -175,8 +176,9 @@ import AVFoundation
175176
Theme.registerSwitchThemeViews(view: self)
176177
self.switchTheme(style: Theme.style)
177178
self.view.addSubview(self.loadingView)
178-
self.processFollowInputAttachmentAction()
179179
}
180+
181+
180182

181183
@objc open func processFollowInputAttachmentAction() {
182184
if Appearance.chat.messageAttachmentMenuStyle == .followInput {
@@ -185,27 +187,6 @@ import AVFoundation
185187
self?.handleAttachmentAction(item: item)
186188
}
187189
}
188-
// if let fileItem = Appearance.chat.inputExtendActions.first(where: { $0.tag == "File" }) {
189-
// fileItem.action = { [weak self] item,object in
190-
// self?.handleAttachmentAction(item: item)
191-
// }
192-
// }
193-
// if let photoItem = Appearance.chat.inputExtendActions.first(where: { $0.tag == "Photo" }) {
194-
// photoItem.action = { [weak self] item,object in
195-
// self?.handleAttachmentAction(item: item)
196-
// }
197-
// }
198-
// if let cameraItem = Appearance.chat.inputExtendActions.first(where: { $0.tag == "Camera" }) {
199-
// cameraItem.action = { [weak self] item,object in
200-
// self?.handleAttachmentAction(item: item)
201-
// }
202-
// }
203-
// if let contactItem = Appearance.chat.inputExtendActions.first(where: { $0.tag == "Contact" }) {
204-
// contactItem.action = { [weak self] item,object in
205-
// self?.handleAttachmentAction(item: item)
206-
// }
207-
// }
208-
209190
}
210191
}
211192

Sources/EaseChatUIKit/Classes/UI/Components/Chat/ViewModel/ChatThreadViewModel.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ import UIKit
168168
ext.merge(json) { _, new in
169169
new
170170
}
171-
var chatMessage = ChatMessage()
171+
var chatMessage: ChatMessage?
172172
switch type {
173173
case .text:
174174
chatMessage = ChatMessage(conversationID: self.to, body: ChatTextMessageBody(text: text), ext: ext)
@@ -228,8 +228,8 @@ import UIKit
228228
default:
229229
break
230230
}
231-
chatMessage.chatType = .groupChat
232-
chatMessage.isChatThreadMessage = true
231+
chatMessage?.chatType = .groupChat
232+
chatMessage?.isChatThreadMessage = true
233233
return chatMessage
234234
}
235235

@@ -613,7 +613,7 @@ extension ChatThreadViewModel: MessageListViewActionEventsDelegate {
613613
}
614614

615615
public func onMessageAvatarLongPressed(profile: ChatUserProfileProtocol) {
616-
self.onMessageAvatarLongPressed(profile: profile)
616+
self.messageAvatarLongPressed(profile: profile)
617617
}
618618

619619
@objc open func messageAvatarLongPressed(profile: ChatUserProfileProtocol) {

Sources/EaseChatUIKit/Classes/UI/Components/Chat/ViewModel/MessageListViewModel.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ import UIKit
196196
ext.merge(json) { _, new in
197197
new
198198
}
199-
var chatMessage = ChatMessage()
199+
var chatMessage: ChatMessage?
200200
switch type {
201201
case .text:
202202
chatMessage = ChatMessage(conversationID: self.to, body: ChatTextMessageBody(text: text), ext: ext)
@@ -258,11 +258,11 @@ import UIKit
258258
}
259259
switch self.chatType {
260260
case .chat:
261-
chatMessage.chatType = .chat
261+
chatMessage?.chatType = .chat
262262
case .group:
263-
chatMessage.chatType = .groupChat
263+
chatMessage?.chatType = .groupChat
264264
case .chatroom:
265-
chatMessage.chatType = .chatRoom
265+
chatMessage?.chatType = .chatRoom
266266
}
267267
return chatMessage
268268
}

0 commit comments

Comments
 (0)