This commit is contained in:
2026-01-15 18:49:31 +08:00
parent 32c4138ae0
commit d479d1903b
7 changed files with 132 additions and 2 deletions

View File

@@ -794,6 +794,26 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
[self kb_playChatAudioAtPath:message.audioFilePath];
}
- (void)chatPanelViewDidTapClose:(KBChatPanelView *)view {
for (KBChatMessage *msg in self.chatMessages) {
if (msg.audioFilePath.length > 0) {
NSString *tmpRoot = NSTemporaryDirectory();
if (tmpRoot.length > 0 &&
[msg.audioFilePath hasPrefix:tmpRoot]) {
[[NSFileManager defaultManager] removeItemAtPath:msg.audioFilePath
error:nil];
}
}
}
[self.chatMessages removeAllObjects];
[self.chatPanelView kb_reloadWithMessages:@[]];
if (self.chatAudioPlayer.isPlaying) {
[self.chatAudioPlayer stop];
}
self.chatAudioPlayer = nil;
[self showChatPanel:NO];
}
#pragma mark - Chat Helpers
- (void)kb_handleChatSendAction {
@@ -1432,6 +1452,7 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
NSLog(@"⌨️[Keyboard] apply theme id=%@ hasBg=%d", t.skinId, (img != nil));
[self kb_logSkinDiagnosticsWithTheme:t backgroundImage:img];
self.bgImageView.image = img;
// [self.chatPanelView kb_setBackgroundImage:img];
BOOL hasImg = (img != nil);
//
if ([self.keyBoardMainView respondsToSelector:@selector(kb_applyTheme)]) {