mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-04-22 23:48:36 +00:00
Handle ICSs in chat list last message
This commit is contained in:
parent
1e1c0fd3d3
commit
d04f961559
2 changed files with 31 additions and 1 deletions
|
|
@ -137,7 +137,8 @@
|
||||||
_chatContentLabel.frame = newFrame;
|
_chatContentLabel.frame = newFrame;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
NSString *text = [[FastAddressBook displayNameForAddress:linphone_chat_message_get_from_address(last_msg)]
|
NSString *conferenceInfo = [ICSBubbleView getConferenceSummaryWithCmessage:last_msg];
|
||||||
|
NSString *text = conferenceInfo != nil ? conferenceInfo : [[FastAddressBook displayNameForAddress:linphone_chat_message_get_from_address(last_msg)]
|
||||||
stringByAppendingFormat:@" : %@", [UIChatBubbleTextCell TextMessageForChat:last_msg]];
|
stringByAppendingFormat:@" : %@", [UIChatBubbleTextCell TextMessageForChat:last_msg]];
|
||||||
// shorten long messages
|
// shorten long messages
|
||||||
/*if ([text length] > 50)
|
/*if ([text length] > 50)
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,35 @@ import EventKitUI
|
||||||
return subject
|
return subject
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc static func getConferenceInfo(cmessage: OpaquePointer) -> OpaquePointer? {
|
||||||
|
let message = ChatMessage.getSwiftObject(cObject: cmessage)
|
||||||
|
var result : OpaquePointer? = nil
|
||||||
|
message.contents.forEach { content in
|
||||||
|
if (content.isIcalendar) {
|
||||||
|
if let conferenceInfo = try? Factory.Instance.createConferenceInfoFromIcalendarContent(content: content) {
|
||||||
|
result = conferenceInfo.getCobject
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc static func getConferenceSummary(cmessage: OpaquePointer) -> String? {
|
||||||
|
let message = ChatMessage.getSwiftObject(cObject: cmessage)
|
||||||
|
var subject:String? = nil
|
||||||
|
message.contents.forEach { content in
|
||||||
|
if (content.isIcalendar) {
|
||||||
|
if let conferenceInfo = try? Factory.Instance.createConferenceInfoFromIcalendarContent(content: content) {
|
||||||
|
subject = conferenceInfo.state == .New ? VoipTexts.conference_invite_title + conferenceInfo.subject :
|
||||||
|
conferenceInfo.state == .Updated ? VoipTexts.conference_update_title + conferenceInfo.subject :
|
||||||
|
VoipTexts.conference_cancel_title + conferenceInfo.subject
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return subject
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@objc static func getDescriptionHeightFromContent(cmessage: OpaquePointer) -> CGFloat {
|
@objc static func getDescriptionHeightFromContent(cmessage: OpaquePointer) -> CGFloat {
|
||||||
let message = ChatMessage.getSwiftObject(cObject: cmessage)
|
let message = ChatMessage.getSwiftObject(cObject: cmessage)
|
||||||
var height = 0.0
|
var height = 0.0
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue