vector-im/element-ios/issues/4090 - Added the VoiceMessage attachement type.
MODIFY
MatrixKit/Models/Room/MXKAttachment.h
MatrixKit/Models/Room/MXKAttachment.h
@@ -29,6 +29,7 @@ typedef enum : NSUInteger {
MXKAttachmentTypeUndefined,
MXKAttachmentTypeImage,
MXKAttachmentTypeAudio,
+ MXKAttachmentTypeVoiceMessage,
MXKAttachmentTypeVideo,
MXKAttachmentTypeLocation,
MXKAttachmentTypeFile,

MODIFY
MatrixKit/Models/Room/MXKAttachment.m
MatrixKit/Models/Room/MXKAttachment.m
@@ -97,8 +97,12 @@ NSString *const kMXKAttachmentErrorDomain = @"kMXKAttachmentErrorDomain";
}
else if ([msgtype isEqualToString:kMXMessageTypeAudio])
{
+ if (eventContent[kMXMessageTypeVoiceMessage]) {
+ _type = MXKAttachmentTypeVoiceMessage;
+ } else {
_type = MXKAttachmentTypeAudio;
}
+ }
else if ([msgtype isEqualToString:kMXMessageTypeVideo])
{
_type = MXKAttachmentTypeVideo;

MODIFY
MatrixKit/Models/Room/MXKRoomBubbleCellData.m
MatrixKit/Models/Room/MXKRoomBubbleCellData.m
if (firstComponent)
{
- CGFloat positionY = (attachment == nil || attachment.type == MXKAttachmentTypeFile || attachment.type == MXKAttachmentTypeAudio) ? MXKROOMBUBBLECELLDATA_TEXTVIEW_DEFAULT_VERTICAL_INSET : 0;
+ CGFloat positionY = (attachment == nil || attachment.type == MXKAttachmentTypeFile || attachment.type == MXKAttachmentTypeAudio || attachment.type == MXKAttachmentTypeVoiceMessage) ? MXKROOMBUBBLECELLDATA_TEXTVIEW_DEFAULT_VERTICAL_INSET : 0;
firstComponent.position = CGPointMake(0, positionY);
}
}

MODIFY
MatrixKit/Views/RoomBubbleList/MXKRoomBubbleTableViewCell.m
MatrixKit/Views/RoomBubbleList/MXKRoomBubbleTableViewCell.m
@@ -1092,7 +1092,7 @@ API_AVAILABLE(ios(10.0)) {
- (BOOL)isBubbleDataContainsFileAttachment
{
return bubbleData.attachment
- && (bubbleData.attachment.type == MXKAttachmentTypeFile || bubbleData.attachment.type == MXKAttachmentTypeAudio)
+ && (bubbleData.attachment.type == MXKAttachmentTypeFile || bubbleData.attachment.type == MXKAttachmentTypeAudio || bubbleData.attachment.type == MXKAttachmentTypeVoiceMessage)
&& bubbleData.attachment.contentURL
&& bubbleData.attachment.contentInfo;
}

vector-im/element-ios/issues/4090 - Added the VoiceMessage attachement type.