Skip to content

Commit

Permalink
element-hq/element-ios/issues/4090 - Made sendVoiceMessage `mimeTyp…
Browse files Browse the repository at this point in the history
…e` optional, defaulting to `audio/ogg`.
  • Loading branch information
stefanceriu committed Jun 9, 2021
1 parent 5fea5d4 commit f85f0f3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Changes to be released in next version
* MXRoomSummary: `lastMessageEvent` property removed for performance reasons (vector-im/element-ios/issues/4360).
* MXRoomSummary: All properties about lastMessage are moved into `lastMessage` property.
* MXSession: Does not compute anymore last events for every room summaries by default. Use -[MXSession eventWithEventId:inRoom:success:failure:] method to load the last event for a room summary.
* MXRoom: Added method for seding voice messages (vector-im/element-ios/issues/4090).

🗣 Translations
*
Expand Down
4 changes: 2 additions & 2 deletions MatrixSDK/Contrib/Swift/Data/MXRoom.swift
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public extension MXRoom {
- parameters:
- localURL: the local filesystem path of the file to send.
- mimeType: the mime type of the file.
- mimeType: (optional) the mime type of the file. Defaults to `audio/ogg`.
- localEcho: a pointer to a MXEvent object.
This pointer is set to an actual MXEvent object
Expand All @@ -319,7 +319,7 @@ public extension MXRoom {
- returns: a `MXHTTPOperation` instance.
*/

@nonobjc @discardableResult func sendVoiceMessage(localURL: URL, mimeType: String, localEcho: inout MXEvent?, completion: @escaping (_ response: MXResponse<String?>) -> Void) -> MXHTTPOperation {
@nonobjc @discardableResult func sendVoiceMessage(localURL: URL, mimeType: String?, localEcho: inout MXEvent?, completion: @escaping (_ response: MXResponse<String?>) -> Void) -> MXHTTPOperation {
return __sendVoiceMessage(localURL, mimeType: mimeType, localEcho: &localEcho, success: currySuccess(completion), failure: curryFailure(completion), keepActualFilename: false)
}

Expand Down
2 changes: 1 addition & 1 deletion MatrixSDK/Data/MXRoom.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ FOUNDATION_EXPORT NSString *const kMXRoomDidFlushDataNotification;
Send a voice message to the room.
@param fileLocalURL the local filesystem path of the file to send.
@param mimeType the mime type of the file.
@param mimeType (optional) the mime type of the file. Defaults to `audio/ogg`
@param localEcho a pointer to a MXEvent object (@see sendMessageWithContent: for details).
@param success A block object called when the operation succeeds. It returns
the event id of the event generated on the home server
Expand Down
2 changes: 1 addition & 1 deletion MatrixSDK/Data/MXRoom.m
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ - (MXHTTPOperation*)sendVoiceMessage:(NSURL*)fileLocalURL
return [self _sendFile:fileLocalURL
msgType:kMXMessageTypeAudio
additionalTypes:@{kMXMessageTypeVoiceMessage : @{}}
mimeType:mimeType
mimeType:(mimeType ?: @"audio/ogg")
localEcho:localEcho
success:success
failure:failure
Expand Down

0 comments on commit f85f0f3

Please sign in to comment.