Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Commit

Permalink
element-hq/element-ios/issues/4090 - Added the VoiceMessage attacheme…
Browse files Browse the repository at this point in the history
…nt type.
  • Loading branch information
stefanceriu committed Jun 23, 2021
1 parent 5d4f3c6 commit e855a71
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions MatrixKit/Models/Room/MXKAttachment.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ typedef enum : NSUInteger {
MXKAttachmentTypeUndefined,
MXKAttachmentTypeImage,
MXKAttachmentTypeAudio,
MXKAttachmentTypeVoiceMessage,
MXKAttachmentTypeVideo,
MXKAttachmentTypeLocation,
MXKAttachmentTypeFile,
Expand Down
6 changes: 5 additions & 1 deletion MatrixKit/Models/Room/MXKAttachment.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ - (instancetype)initWithEvent:(MXEvent*)event andMediaManager:(MXMediaManager*)m
}
else if ([msgtype isEqualToString:kMXMessageTypeAudio])
{
_type = MXKAttachmentTypeAudio;
if (eventContent[kMXMessageTypeVoiceMessage]) {
_type = MXKAttachmentTypeVoiceMessage;
} else {
_type = MXKAttachmentTypeAudio;
}
}
else if ([msgtype isEqualToString:kMXMessageTypeVideo])
{
Expand Down
2 changes: 1 addition & 1 deletion MatrixKit/Models/Room/MXKRoomBubbleCellData.m
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ - (void)prepareBubbleComponentsPosition

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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ - (BOOL)shouldInteractWithURL:(NSURL *)URL urlItemInteractionValue:(NSNumber*)ur
- (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;
}
Expand Down

0 comments on commit e855a71

Please sign in to comment.