Skip to content

Commit 7e51369

Browse files
committed
Bump to version 25.08.01 (matrix-rust-sdk/main 033c6bd6a4fdf198d51bec0048105dbcc041b235)
1 parent 758b55b commit 7e51369

File tree

3 files changed

+221
-191
lines changed

3 files changed

+221
-191
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// swift-tools-version:5.9
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33
import PackageDescription
4-
let checksum = "175673536811fa8947f0001b2221524ac43db45708a8659da21826da6f52e292"
5-
let version = "25.07.29"
4+
let checksum = "faf1119d4ae7478ac6b7ce9897b27de645a2c016dcd0a9c329f9493e16e9f5b0"
5+
let version = "25.08.01"
66
let url = "https://github.com/element-hq/matrix-rust-components-swift/releases/download/\(version)/MatrixSDKFFI.xcframework.zip"
77
let package = Package(
88
name: "MatrixRustSDK",

Sources/MatrixRustSDK/matrix_sdk.swift

Lines changed: 103 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,11 @@ public struct VirtualElementCallWidgetOptions {
891891
* client. (used on ios & android)
892892
*/
893893
public var controlledMediaDevices: Bool
894+
/**
895+
* Whether and what type of notification Element Call should send, when
896+
* starting a call.
897+
*/
898+
public var sendNotificationType: NotificationType?
894899

895900
// Default memberwise initializers are never public by default, so we
896901
// declare one manually.
@@ -993,7 +998,11 @@ public struct VirtualElementCallWidgetOptions {
993998
/**
994999
* - `false`: the webview shows a a list of devices injected by the
9951000
* client. (used on ios & android)
996-
*/controlledMediaDevices: Bool) {
1001+
*/controlledMediaDevices: Bool,
1002+
/**
1003+
* Whether and what type of notification Element Call should send, when
1004+
* starting a call.
1005+
*/sendNotificationType: NotificationType?) {
9971006
self.elementCallUrl = elementCallUrl
9981007
self.widgetId = widgetId
9991008
self.parentUrl = parentUrl
@@ -1014,6 +1023,7 @@ public struct VirtualElementCallWidgetOptions {
10141023
self.sentryDsn = sentryDsn
10151024
self.sentryEnvironment = sentryEnvironment
10161025
self.controlledMediaDevices = controlledMediaDevices
1026+
self.sendNotificationType = sendNotificationType
10171027
}
10181028
}
10191029

@@ -1081,6 +1091,9 @@ extension VirtualElementCallWidgetOptions: Equatable, Hashable {
10811091
if lhs.controlledMediaDevices != rhs.controlledMediaDevices {
10821092
return false
10831093
}
1094+
if lhs.sendNotificationType != rhs.sendNotificationType {
1095+
return false
1096+
}
10841097
return true
10851098
}
10861099

@@ -1105,6 +1118,7 @@ extension VirtualElementCallWidgetOptions: Equatable, Hashable {
11051118
hasher.combine(sentryDsn)
11061119
hasher.combine(sentryEnvironment)
11071120
hasher.combine(controlledMediaDevices)
1121+
hasher.combine(sendNotificationType)
11081122
}
11091123
}
11101124

@@ -1132,7 +1146,8 @@ public struct FfiConverterTypeVirtualElementCallWidgetOptions: FfiConverterRustB
11321146
rageshakeSubmitUrl: FfiConverterOptionString.read(from: &buf),
11331147
sentryDsn: FfiConverterOptionString.read(from: &buf),
11341148
sentryEnvironment: FfiConverterOptionString.read(from: &buf),
1135-
controlledMediaDevices: FfiConverterBool.read(from: &buf)
1149+
controlledMediaDevices: FfiConverterBool.read(from: &buf),
1150+
sendNotificationType: FfiConverterOptionTypeNotificationType.read(from: &buf)
11361151
)
11371152
}
11381153

@@ -1157,6 +1172,7 @@ public struct FfiConverterTypeVirtualElementCallWidgetOptions: FfiConverterRustB
11571172
FfiConverterOptionString.write(value.sentryDsn, into: &buf)
11581173
FfiConverterOptionString.write(value.sentryEnvironment, into: &buf)
11591174
FfiConverterBool.write(value.controlledMediaDevices, into: &buf)
1175+
FfiConverterOptionTypeNotificationType.write(value.sendNotificationType, into: &buf)
11601176
}
11611177
}
11621178

@@ -1480,6 +1496,70 @@ extension Intent: Equatable, Hashable {}
14801496

14811497

14821498

1499+
// Note that we don't yet support `indirect` for enums.
1500+
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
1501+
/**
1502+
* Types of call notifications.
1503+
*/
1504+
1505+
public enum NotificationType {
1506+
1507+
/**
1508+
* The receiving client should display a visual notification.
1509+
*/
1510+
case notification
1511+
/**
1512+
* The receiving client should ring with an audible sound.
1513+
*/
1514+
case ring
1515+
}
1516+
1517+
1518+
public struct FfiConverterTypeNotificationType: FfiConverterRustBuffer {
1519+
typealias SwiftType = NotificationType
1520+
1521+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NotificationType {
1522+
let variant: Int32 = try readInt(&buf)
1523+
switch variant {
1524+
1525+
case 1: return .notification
1526+
1527+
case 2: return .ring
1528+
1529+
default: throw UniffiInternalError.unexpectedEnumCase
1530+
}
1531+
}
1532+
1533+
public static func write(_ value: NotificationType, into buf: inout [UInt8]) {
1534+
switch value {
1535+
1536+
1537+
case .notification:
1538+
writeInt(&buf, Int32(1))
1539+
1540+
1541+
case .ring:
1542+
writeInt(&buf, Int32(2))
1543+
1544+
}
1545+
}
1546+
}
1547+
1548+
1549+
public func FfiConverterTypeNotificationType_lift(_ buf: RustBuffer) throws -> NotificationType {
1550+
return try FfiConverterTypeNotificationType.lift(buf)
1551+
}
1552+
1553+
public func FfiConverterTypeNotificationType_lower(_ value: NotificationType) -> RustBuffer {
1554+
return FfiConverterTypeNotificationType.lower(value)
1555+
}
1556+
1557+
1558+
1559+
extension NotificationType: Equatable, Hashable {}
1560+
1561+
1562+
14831563
// Note that we don't yet support `indirect` for enums.
14841564
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
14851565
/**
@@ -2007,6 +2087,27 @@ fileprivate struct FfiConverterOptionTypeIntent: FfiConverterRustBuffer {
20072087
}
20082088
}
20092089

2090+
fileprivate struct FfiConverterOptionTypeNotificationType: FfiConverterRustBuffer {
2091+
typealias SwiftType = NotificationType?
2092+
2093+
public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
2094+
guard let value = value else {
2095+
writeInt(&buf, Int8(0))
2096+
return
2097+
}
2098+
writeInt(&buf, Int8(1))
2099+
FfiConverterTypeNotificationType.write(value, into: &buf)
2100+
}
2101+
2102+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
2103+
switch try readInt(&buf) as Int8 {
2104+
case 0: return nil
2105+
case 1: return try FfiConverterTypeNotificationType.read(from: &buf)
2106+
default: throw UniffiInternalError.unexpectedOptionalTag
2107+
}
2108+
}
2109+
}
2110+
20102111
private enum InitializationResult {
20112112
case ok
20122113
case contractVersionMismatch

0 commit comments

Comments
 (0)