Skip to content

Commit

Permalink
build version 3.9.18
Browse files Browse the repository at this point in the history
  • Loading branch information
yangsisi committed Oct 14, 2024
1 parent 7fe4b42 commit e8c186e
Show file tree
Hide file tree
Showing 20 changed files with 85 additions and 38 deletions.
16 changes: 8 additions & 8 deletions Meiqia-SDK-Demo/Meiqia-SDK-Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
36A950BC2864590E0052645C /* MQAGEmojiPageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 36A94F442864590D0052645C /* MQAGEmojiPageView.m */; };
36A950BD2864590E0052645C /* MEIQIA_VoiceConverter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 36A94F492864590D0052645C /* MEIQIA_VoiceConverter.mm */; };
36A950BE2864590E0052645C /* wav.mm in Sources */ = {isa = PBXBuildFile; fileRef = 36A94F4B2864590D0052645C /* wav.mm */; };
36A950BF2864590E0052645C /* amrFileCodec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 36A94F4C2864590D0052645C /* amrFileCodec.mm */; };
36A950C02864590E0052645C /* MEIQIA_CustomIOSAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 36A94F512864590D0052645C /* MEIQIA_CustomIOSAlertView.m */; };
36A950C12864590E0052645C /* MEIQIA_InputView.m in Sources */ = {isa = PBXBuildFile; fileRef = 36A94F542864590D0052645C /* MEIQIA_InputView.m */; };
36A950C22864590E0052645C /* MEIQIA_EmojiCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 36A94F552864590D0052645C /* MEIQIA_EmojiCell.m */; };
Expand Down Expand Up @@ -205,6 +204,7 @@
CCE9D1461C181399004E862E /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CCE9D1451C181399004E862E /* SystemConfiguration.framework */; };
CCE9D1481C18139E004E862E /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CCE9D1471C18139E004E862E /* MobileCoreServices.framework */; };
CCE9D14D1C1813BE004E862E /* DevelopViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CCE9D14C1C1813BE004E862E /* DevelopViewController.m */; };
DA149C062CA956CC0007867D /* MEIQIA_amrFileCodec.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA149C052CA956CC0007867D /* MEIQIA_amrFileCodec.mm */; };
E40C2C7B1D2B710300744577 /* testdata.txt in Resources */ = {isa = PBXBuildFile; fileRef = E40C2C7A1D2B710300744577 /* testdata.txt */; };
E41DDDA61DD18DE0000B3083 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = E41DDDA51DD18DE0000B3083 /* libz.tbd */; };
E4275AD91DEC1B5F0011B32B /* MQOnlineTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E4275AD51DEC16400011B32B /* MQOnlineTests.m */; };
Expand Down Expand Up @@ -312,8 +312,6 @@
36A94F482864590D0052645C /* MEIQIA_VoiceConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MEIQIA_VoiceConverter.h; sourceTree = "<group>"; };
36A94F492864590D0052645C /* MEIQIA_VoiceConverter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MEIQIA_VoiceConverter.mm; sourceTree = "<group>"; };
36A94F4B2864590D0052645C /* wav.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = wav.mm; sourceTree = "<group>"; };
36A94F4C2864590D0052645C /* amrFileCodec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = amrFileCodec.mm; sourceTree = "<group>"; };
36A94F4D2864590D0052645C /* amrFileCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = amrFileCodec.h; sourceTree = "<group>"; };
36A94F4E2864590D0052645C /* wav.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wav.h; sourceTree = "<group>"; };
36A94F4F2864590D0052645C /* MQNamespacedDependencies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MQNamespacedDependencies.h; sourceTree = "<group>"; };
36A94F512864590D0052645C /* MEIQIA_CustomIOSAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MEIQIA_CustomIOSAlertView.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -649,6 +647,8 @@
CCE9D1471C18139E004E862E /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
CCE9D14B1C1813BE004E862E /* DevelopViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DevelopViewController.h; sourceTree = "<group>"; };
CCE9D14C1C1813BE004E862E /* DevelopViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DevelopViewController.m; sourceTree = "<group>"; };
DA149C042CA956CC0007867D /* MEIQIA_amrFileCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MEIQIA_amrFileCodec.h; path = "../../../../../../sdk-ios-demo/MQEcoboostSDK-test/MQChatViewController/Vendors/VoiceConvert/amrwapper/MEIQIA_amrFileCodec.h"; sourceTree = "<group>"; };
DA149C052CA956CC0007867D /* MEIQIA_amrFileCodec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MEIQIA_amrFileCodec.mm; path = "../../../../../../sdk-ios-demo/MQEcoboostSDK-test/MQChatViewController/Vendors/VoiceConvert/amrwapper/MEIQIA_amrFileCodec.mm"; sourceTree = "<group>"; };
E40C2C7A1D2B710300744577 /* testdata.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = testdata.txt; sourceTree = "<group>"; };
E41DDDA51DD18DE0000B3083 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
E4275AD51DEC16400011B32B /* MQOnlineTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MQOnlineTests.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -933,8 +933,8 @@
36A94F4A2864590D0052645C /* amrwapper */ = {
isa = PBXGroup;
children = (
36A94F4D2864590D0052645C /* amrFileCodec.h */,
36A94F4C2864590D0052645C /* amrFileCodec.mm */,
DA149C042CA956CC0007867D /* MEIQIA_amrFileCodec.h */,
DA149C052CA956CC0007867D /* MEIQIA_amrFileCodec.mm */,
36A94F4E2864590D0052645C /* wav.h */,
36A94F4B2864590D0052645C /* wav.mm */,
);
Expand Down Expand Up @@ -1866,6 +1866,7 @@
36A950C12864590E0052645C /* MEIQIA_InputView.m in Sources */,
36A951502864590E0052645C /* UIColor+MQHex.m in Sources */,
CCE9D10E1C1812F6004E862E /* AppDelegate.m in Sources */,
DA149C062CA956CC0007867D /* MEIQIA_amrFileCodec.mm in Sources */,
36A950EB2864590E0052645C /* MQMessageFactoryHelper.m in Sources */,
36A9513D2864590E0052645C /* MQTagListView.m in Sources */,
36A9511A2864590E0052645C /* MQAnimatorPush.m in Sources */,
Expand All @@ -1891,7 +1892,6 @@
36A951442864590E0052645C /* MQRecorderView.m in Sources */,
36A9511F2864590E0052645C /* MQBundleUtil.m in Sources */,
36A950E42864590E0052645C /* MQPhotoCardMessage.m in Sources */,
36A950BF2864590E0052645C /* amrFileCodec.mm in Sources */,
36A950CB2864590E0052645C /* MEIQIA_FBSquareFont.m in Sources */,
36A950B62864590E0052645C /* MQMessageFormChoiceView.m in Sources */,
CBF12C872AB18FB200FBA29F /* MQCardMessageCell.m in Sources */,
Expand Down Expand Up @@ -2213,7 +2213,7 @@
"$(SRCROOT)/../Meiqia-SDK-files/MQChatViewController/Vendors/MLAudioRecorder/amr_en_de/**",
"$(PROJECT_DIR)/MeiqiaSDK/MQChatViewController/Vendors/MLAudioRecorder/amr_en_de/lib",
);
MARKETING_VERSION = 3.9.17;
MARKETING_VERSION = 3.9.18;
OTHER_LDFLAGS = "-all_load";
PRODUCT_BUNDLE_IDENTIFIER = com.meiqia.sdk.test.demo;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -2257,7 +2257,7 @@
"$(SRCROOT)/../Meiqia-SDK-files/MQChatViewController/Vendors/MLAudioRecorder/amr_en_de/**",
"$(PROJECT_DIR)/MeiqiaSDK/MQChatViewController/Vendors/MLAudioRecorder/amr_en_de/lib",
);
MARKETING_VERSION = 3.9.17;
MARKETING_VERSION = 3.9.18;
OTHER_LDFLAGS = "-all_load";
PRODUCT_BUNDLE_IDENTIFIER = com.meiqia.sdk.test.demo;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,22 @@ - (void)presentUI {
NSString *targetType = userInfo[@"targetType"];
NSString *target = userInfo[@"target"];
NSString *menu = userInfo[@"menu"];
NSInteger fallback = [[userInfo objectForKey:@"fallback"] integerValue];
if ([targetType isEqualToString:@"agent"]) {
[MQChatViewConfig sharedConfig].scheduledAgentId = target;
} else if ([targetType isEqualToString:@"group"]) {
[MQChatViewConfig sharedConfig].scheduledGroupId = target;
}
if (fallback && fallback > 0) {
[MQChatViewConfig sharedConfig].scheduleRule = fallback;
}

if ([menu length] > 0) {
[weakSelf.chatViewService selectedFormProblem:menu];
NSMutableArray *m = [[MQChatViewConfig sharedConfig].preSendMessages mutableCopy] ?: [NSMutableArray new];
[m addObject:menu];
[MQChatViewConfig sharedConfig].preSendMessages = m;
// 添加 fallback 后 取消发送一条消息
// NSMutableArray *m = [[MQChatViewConfig sharedConfig].preSendMessages mutableCopy] ?: [NSMutableArray new];
// [m addObject:menu];
// [MQChatViewConfig sharedConfig].preSendMessages = m;
}
// TODO: [MQServiceToViewInterface prepareForChat]也会初始化企业配置,这里会导致获取企业配置的接口调用两次,APP第一次初始化时会调3次
[MQServiceToViewInterface getEnterpriseConfigInfoWithCache:NO complete:^(MQEnterprise *enterprise, NSError *e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -880,8 +880,9 @@ - (void)playSendedMessageSound {
cellModel = [[MQWebViewBubbleCellModel alloc] initCellModelWithMessage:(MQRichTextMessage *)message cellWidth:self.chatViewWidth delegate:self];

} else if ([message isKindOfClass:[MQBotAnswerMessage class]]) {

if ([(MQBotAnswerMessage *)message menu] == nil) {
if ([[(MQBotAnswerMessage *)message subType] isEqualToString:@"reply"] && ![MQServiceToViewInterface enableLeaveComment]) { // 不留言才显示为tips
[self addTipCellModelWithType:MQTipTypeReply tipText:[(MQBotAnswerMessage *)message content]];
} else if ([(MQBotAnswerMessage *)message menu] == nil) {
cellModel = [[MQBotAnswerCellModel alloc] initCellModelWithMessage:(MQBotAnswerMessage *)message cellWidth:self.chatViewWidth delegate:self];
} else {
cellModel = [[MQBotMenuAnswerCellModel alloc] initCellModelWithMessage:(MQBotAnswerMessage *)message cellWidth:self.chatViewWidth delegate:self];
Expand Down Expand Up @@ -1084,11 +1085,15 @@ - (void)addTipCellModelWithTips:(NSString *)tips enableLinesDisplay:(BOOL)enable
}

// 增加留言提示的 cell model
- (void)addTipCellModelWithType:(MQTipType)tipType {
- (void)addTipCellModelWithType:(MQTipType)tipType tipText:(NSString *)tipText {
// 判断当前是否是机器人客服
if ([MQServiceToViewInterface getCurrentAgent].privilege != MQAgentPrivilegeBot) {
return;
}
// 如果当前是回复留言,允许留言显示为气泡样式,不显示 tips
if (tipType == MQTipTypeReply && [MQServiceToViewInterface enableLeaveComment]) {
return;
}
// 判断 table 中是否出现「转人工」或「留言」,如果出现过,并不在最后一个 cell,则将之移到底部
MQTipsCellModel *tipModel = nil;
if (tipType == MQTipTypeReply || tipType == MQTipTypeBotRedirect || tipType == MQTipTypeBotManualRedirect) {
Expand All @@ -1108,7 +1113,7 @@ - (void)addTipCellModelWithType:(MQTipType)tipType {
[self.cellModels addObject:tipModel];
[self.delegate reloadChatTableView];
} else {
MQTipsCellModel *cellModel = [[MQTipsCellModel alloc] initBotTipCellModelWithCellWidth:self.chatViewWidth tipType:tipType showLeaveCommentBtn:[MQServiceToViewInterface enableLeaveComment]];
MQTipsCellModel *cellModel = [[MQTipsCellModel alloc] initBotTipCellModelWithTips:tipText cellWidth:self.chatViewWidth tipType:tipType showLeaveCommentBtn:[MQServiceToViewInterface enableLeaveComment]];
[self.cellModels addObject:cellModel];
[self.delegate insertCellAtBottomForModelCount: 1];
}
Expand Down Expand Up @@ -1220,7 +1225,7 @@ - (void)onlineWithClientId {
}

- (void)removeScheduledAgentWithType:(NSString *)agentType {
if (![agentType isEqualToString:@"bot"]) {
if (agentType.length > 0 && ![agentType isEqualToString:@"bot"]) {
[MQServiceToViewInterface deleteScheduledAgent];
}
}
Expand Down Expand Up @@ -1310,7 +1315,7 @@ - (void)afterClientOnline {
NSError * error = [MQServiceToViewInterface checkGlobalError];
if (error) {
if (error.code == MQErrorCodeBotFailToRedirectToHuman) {
[self addTipCellModelWithType:MQTipTypeReply];
[self addTipCellModelWithType:MQTipTypeReply tipText:@""];
}
}

Expand Down Expand Up @@ -1714,7 +1719,7 @@ - (void)didReceiveNewMessages:(NSArray *)messages {
MQEventMessage *eventMessage = (MQEventMessage *)[messages firstObject];
if (eventMessage.eventType == MQChatEventTypeRedirectFail) {
//转人工失败
[self addTipCellModelWithType:MQTipTypeReply];
[self addTipCellModelWithType:MQTipTypeReply tipText:@""];
} else {
[self handleEventMessage:eventMessage];
}
Expand Down Expand Up @@ -1747,7 +1752,7 @@ - (void)didReceiveNewMessages:(NSArray *)messages {
}
//渲染手动转人工
if ([((MQBotAnswerMessage *)[messages firstObject]).subType isEqualToString:@"manual_redirect"]) {
[self addTipCellModelWithType:MQTipTypeBotManualRedirect];
[self addTipCellModelWithType:MQTipTypeBotManualRedirect tipText:@""];
}
}

Expand Down Expand Up @@ -1933,7 +1938,7 @@ - (void)evaluateBotAnswer:(BOOL)isUseful messageId:(NSString *)messageId {
MQAgent *agent = [MQServiceToViewInterface getCurrentAgent];
if (!isUseful && agent.privilege == MQAgentPrivilegeBot) {
// 生成转人工的状态
[self addTipCellModelWithType:MQTipTypeBotRedirect];
[self addTipCellModelWithType:MQTipTypeBotRedirect tipText:@""];
}
}];
// 改变 botAnswerCellModel 的值
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ - (void)gotoFormViewControllerWithSelectedMenuIndexPath:(NSIndexPath *)indexPath
if (self.completeBlock) {
NSString *target = selectedMenu.target;
NSString *targetType = selectedMenu.targetKind;
self.completeBlock(@{@"target":target, @"targetType":targetType, @"menu":selectedMenu.desc});
NSInteger fallback = selectedMenu.fallback;
self.completeBlock(@{@"target":target, @"targetType":targetType, @"menu":selectedMenu.desc, @"fallback": @(fallback)});
}
}];
} else {
Expand All @@ -185,7 +186,8 @@ - (void)gotoFormViewControllerWithSelectedMenuIndexPath:(NSIndexPath *)indexPath
if (self.completeBlock) {
NSString *target = selectedMenu.target;
NSString *targetType = selectedMenu.targetKind;
self.completeBlock(@{@"target":target, @"targetType":targetType, @"menu":selectedMenu.desc});
NSInteger fallback = selectedMenu.fallback;
self.completeBlock(@{@"target":target, @"targetType":targetType, @"menu":selectedMenu.desc, @"fallback": @(fallback)});
}
}];
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ - (NSDictionary *)createUserInfo {
if (self.selectedMenuItem) {
NSString *target = self.selectedMenuItem.target;
NSString *targetType = self.selectedMenuItem.targetKind;

return @{@"target":target, @"targetType":targetType, @"menu":[self.selectedMenuItem desc]};
NSInteger fallback = self.selectedMenuItem.fallback;
return @{@"target":target, @"targetType":targetType, @"menu":[self.selectedMenuItem desc], @"fallback": @(fallback)};
} else {
return nil;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ - (MQBaseMessage *)getNormalBotAnswerMessage:(NSDictionary *)data subType:(NSStr
BOOL isEvaluated = [data objectForKey:@"is_evaluated"] ? [[data objectForKey:@"is_evaluated"] boolValue] : false;
BOOL isSolved = [data objectForKey:@"is_useful"] ? [[data objectForKey:@"is_useful"] boolValue] : YES;

if ([subType isEqualToString:@"reply"] && ![MQManager enableLeaveComment]) {
subType = @"normal";
}
// if ([subType isEqualToString:@"reply"] && ![MQManager enableLeaveComment]) {
// subType = @"normal";
// }
MQBotAnswerMessage *botMessage = [[MQBotAnswerMessage alloc] initWithContent:content subType:subType isEvaluated:isEvaluated];
botMessage.solved = isSolved;
if (embedMenuMessage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ @implementation MQMessageFactoryHelper

+ (id<MQMessageFactory>)factoryWithMessageAction:(MQMessageAction)action contentType:(MQMessageContentType)contenType fromType:(MQMessageFromType)fromType {
if (action == MQMessageActionMessage || action == MQMessageActionTicketReply || action == MQMessageActionAgentSendCard) {
if (contenType == MQMessageContentTypeBot || (contenType == MQMessageContentTypeHybrid && fromType == MQMessageFromTypeBot)) {
if (contenType == MQMessageContentTypeBot || ((contenType == MQMessageContentTypeHybrid || contenType == MQMessageCardTypeText) && fromType == MQMessageFromTypeBot)) {
return [MQBotMessageFactory new];
} else {
return [MQVisialMessageFactory new];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ typedef NS_ENUM(NSUInteger, MQTipType) {
*/
@property (nonatomic, readonly, assign) MQTipType tipType;

/**
* 是否显示留言按钮
*/
@property (nonatomic, readonly, assign) BOOL showLeaveCommentBtn;

/**
* 根据tips内容来生成cell model
*/
Expand All @@ -96,7 +101,10 @@ typedef NS_ENUM(NSUInteger, MQTipType) {
/**
* 生成留言提示的 cell,支持点击留言
*/
- (MQTipsCellModel *)initBotTipCellModelWithCellWidth:(CGFloat)cellWidth tipType:(MQTipType)tipType showLeaveCommentBtn:(BOOL)showBtn;
- (MQTipsCellModel *)initBotTipCellModelWithTips:(NSString *)tips
cellWidth:(CGFloat)cellWidth
tipType:(MQTipType)tipType
showLeaveCommentBtn:(BOOL)showBtn;

- (MQTipsCellModel *)initWaitingInQueueTipCellModelWithCellWidth:(CGFloat)cellWidth withIntro:(NSString *)intro ticketIntro:(NSString *)ticketIntro position:(int)position tipType:(MQTipType)tipType showLeaveCommentBtn:(BOOL)showBtn;

Expand Down
Loading

0 comments on commit e8c186e

Please sign in to comment.