@@ -3869,8 +3869,6 @@ public protocol RoomProtocol : AnyObject {
3869
3869
3870
3870
func banUser(userId: String, reason: String?) async throws
3871
3871
3872
- func buildPowerLevelChangesFromCurrent() async throws -> RoomPowerLevelChanges
3873
-
3874
3872
func canUserBan(userId: String) async throws -> Bool
3875
3873
3876
3874
func canUserInvite(userId: String) async throws -> Bool
@@ -3902,6 +3900,8 @@ public protocol RoomProtocol : AnyObject {
3902
3900
3903
3901
func displayName() throws -> String
3904
3902
3903
+ func getPowerLevels() async throws -> RoomPowerLevels
3904
+
3905
3905
/**
3906
3906
* Is there a non expired membership with application "m.call" and scope
3907
3907
* "m.room" in this room.
@@ -4008,6 +4008,8 @@ public protocol RoomProtocol : AnyObject {
4008
4008
*/
4009
4009
func reportContent(eventId: String, score: Int32?, reason: String?) throws
4010
4010
4011
+ func resetPowerLevels() async throws -> RoomPowerLevels
4012
+
4011
4013
func roomInfo() async throws -> RoomInfo
4012
4014
4013
4015
func setIsFavourite(isFavourite: Bool, tagOrder: Double?) async throws
@@ -4191,22 +4193,6 @@ open class Room:
4191
4193
}
4192
4194
4193
4195
4194
- open func buildPowerLevelChangesFromCurrent() async throws -> RoomPowerLevelChanges {
4195
- return try await uniffiRustCallAsync(
4196
- rustFutureFunc: {
4197
- uniffi_matrix_sdk_ffi_fn_method_room_build_power_level_changes_from_current(
4198
- self.uniffiClonePointer()
4199
- )
4200
- },
4201
- pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer,
4202
- completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
4203
- freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
4204
- liftFunc: FfiConverterTypeRoomPowerLevelChanges_lift,
4205
- errorHandler: FfiConverterTypeClientError.lift
4206
- )
4207
- }
4208
-
4209
-
4210
4196
open func canUserBan(userId: String) async throws -> Bool {
4211
4197
return try await uniffiRustCallAsync(
4212
4198
rustFutureFunc: {
@@ -4389,6 +4375,22 @@ open class Room:
4389
4375
}
4390
4376
)
4391
4377
}
4378
+ open func getPowerLevels() async throws -> RoomPowerLevels {
4379
+ return try await uniffiRustCallAsync(
4380
+ rustFutureFunc: {
4381
+ uniffi_matrix_sdk_ffi_fn_method_room_get_power_levels(
4382
+ self.uniffiClonePointer()
4383
+ )
4384
+ },
4385
+ pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer,
4386
+ completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
4387
+ freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
4388
+ liftFunc: FfiConverterTypeRoomPowerLevels.lift,
4389
+ errorHandler: FfiConverterTypeClientError.lift
4390
+ )
4391
+ }
4392
+
4393
+
4392
4394
/**
4393
4395
* Is there a non expired membership with application "m.call" and scope
4394
4396
* "m.room" in this room.
@@ -4739,6 +4741,22 @@ open class Room:
4739
4741
)
4740
4742
}
4741
4743
}
4744
+ open func resetPowerLevels() async throws -> RoomPowerLevels {
4745
+ return try await uniffiRustCallAsync(
4746
+ rustFutureFunc: {
4747
+ uniffi_matrix_sdk_ffi_fn_method_room_reset_power_levels(
4748
+ self.uniffiClonePointer()
4749
+ )
4750
+ },
4751
+ pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer,
4752
+ completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
4753
+ freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
4754
+ liftFunc: FfiConverterTypeRoomPowerLevels.lift,
4755
+ errorHandler: FfiConverterTypeClientError.lift
4756
+ )
4757
+ }
4758
+
4759
+
4742
4760
open func roomInfo() async throws -> RoomInfo {
4743
4761
return try await uniffiRustCallAsync(
4744
4762
rustFutureFunc: {
@@ -11307,6 +11325,196 @@ public func FfiConverterTypeRoomNotificationSettings_lower(_ value: RoomNotifica
11307
11325
}
11308
11326
11309
11327
11328
+ public struct RoomPowerLevels {
11329
+ /**
11330
+ * The level required to ban a user.
11331
+ */
11332
+ public var ban: Int64
11333
+ /**
11334
+ * The level required to invite a user.
11335
+ */
11336
+ public var invite: Int64
11337
+ /**
11338
+ * The level required to kick a user.
11339
+ */
11340
+ public var kick: Int64
11341
+ /**
11342
+ * The level required to redact an event.
11343
+ */
11344
+ public var redact: Int64
11345
+ /**
11346
+ * The default level required to send message events.
11347
+ */
11348
+ public var eventsDefault: Int64
11349
+ /**
11350
+ * The default level required to send state events.
11351
+ */
11352
+ public var stateDefault: Int64
11353
+ /**
11354
+ * The default power level for every user in the room.
11355
+ */
11356
+ public var usersDefault: Int64
11357
+ /**
11358
+ * The level required to change the room's name.
11359
+ */
11360
+ public var roomName: Int64
11361
+ /**
11362
+ * The level required to change the room's avatar.
11363
+ */
11364
+ public var roomAvatar: Int64
11365
+ /**
11366
+ * The level required to change the room's topic.
11367
+ */
11368
+ public var roomTopic: Int64
11369
+
11370
+ // Default memberwise initializers are never public by default, so we
11371
+ // declare one manually.
11372
+ public init(
11373
+ /**
11374
+ * The level required to ban a user.
11375
+ */
11376
+ ban: Int64,
11377
+ /**
11378
+ * The level required to invite a user.
11379
+ */
11380
+ invite: Int64,
11381
+ /**
11382
+ * The level required to kick a user.
11383
+ */
11384
+ kick: Int64,
11385
+ /**
11386
+ * The level required to redact an event.
11387
+ */
11388
+ redact: Int64,
11389
+ /**
11390
+ * The default level required to send message events.
11391
+ */
11392
+ eventsDefault: Int64,
11393
+ /**
11394
+ * The default level required to send state events.
11395
+ */
11396
+ stateDefault: Int64,
11397
+ /**
11398
+ * The default power level for every user in the room.
11399
+ */
11400
+ usersDefault: Int64,
11401
+ /**
11402
+ * The level required to change the room's name.
11403
+ */
11404
+ roomName: Int64,
11405
+ /**
11406
+ * The level required to change the room's avatar.
11407
+ */
11408
+ roomAvatar: Int64,
11409
+ /**
11410
+ * The level required to change the room's topic.
11411
+ */
11412
+ roomTopic: Int64) {
11413
+ self.ban = ban
11414
+ self.invite = invite
11415
+ self.kick = kick
11416
+ self.redact = redact
11417
+ self.eventsDefault = eventsDefault
11418
+ self.stateDefault = stateDefault
11419
+ self.usersDefault = usersDefault
11420
+ self.roomName = roomName
11421
+ self.roomAvatar = roomAvatar
11422
+ self.roomTopic = roomTopic
11423
+ }
11424
+ }
11425
+
11426
+
11427
+ extension RoomPowerLevels: Equatable, Hashable {
11428
+ public static func ==(lhs: RoomPowerLevels, rhs: RoomPowerLevels) -> Bool {
11429
+ if lhs.ban != rhs.ban {
11430
+ return false
11431
+ }
11432
+ if lhs.invite != rhs.invite {
11433
+ return false
11434
+ }
11435
+ if lhs.kick != rhs.kick {
11436
+ return false
11437
+ }
11438
+ if lhs.redact != rhs.redact {
11439
+ return false
11440
+ }
11441
+ if lhs.eventsDefault != rhs.eventsDefault {
11442
+ return false
11443
+ }
11444
+ if lhs.stateDefault != rhs.stateDefault {
11445
+ return false
11446
+ }
11447
+ if lhs.usersDefault != rhs.usersDefault {
11448
+ return false
11449
+ }
11450
+ if lhs.roomName != rhs.roomName {
11451
+ return false
11452
+ }
11453
+ if lhs.roomAvatar != rhs.roomAvatar {
11454
+ return false
11455
+ }
11456
+ if lhs.roomTopic != rhs.roomTopic {
11457
+ return false
11458
+ }
11459
+ return true
11460
+ }
11461
+
11462
+ public func hash(into hasher: inout Hasher) {
11463
+ hasher.combine(ban)
11464
+ hasher.combine(invite)
11465
+ hasher.combine(kick)
11466
+ hasher.combine(redact)
11467
+ hasher.combine(eventsDefault)
11468
+ hasher.combine(stateDefault)
11469
+ hasher.combine(usersDefault)
11470
+ hasher.combine(roomName)
11471
+ hasher.combine(roomAvatar)
11472
+ hasher.combine(roomTopic)
11473
+ }
11474
+ }
11475
+
11476
+
11477
+ public struct FfiConverterTypeRoomPowerLevels: FfiConverterRustBuffer {
11478
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RoomPowerLevels {
11479
+ return
11480
+ try RoomPowerLevels(
11481
+ ban: FfiConverterInt64.read(from: &buf),
11482
+ invite: FfiConverterInt64.read(from: &buf),
11483
+ kick: FfiConverterInt64.read(from: &buf),
11484
+ redact: FfiConverterInt64.read(from: &buf),
11485
+ eventsDefault: FfiConverterInt64.read(from: &buf),
11486
+ stateDefault: FfiConverterInt64.read(from: &buf),
11487
+ usersDefault: FfiConverterInt64.read(from: &buf),
11488
+ roomName: FfiConverterInt64.read(from: &buf),
11489
+ roomAvatar: FfiConverterInt64.read(from: &buf),
11490
+ roomTopic: FfiConverterInt64.read(from: &buf)
11491
+ )
11492
+ }
11493
+
11494
+ public static func write(_ value: RoomPowerLevels, into buf: inout [UInt8]) {
11495
+ FfiConverterInt64.write(value.ban, into: &buf)
11496
+ FfiConverterInt64.write(value.invite, into: &buf)
11497
+ FfiConverterInt64.write(value.kick, into: &buf)
11498
+ FfiConverterInt64.write(value.redact, into: &buf)
11499
+ FfiConverterInt64.write(value.eventsDefault, into: &buf)
11500
+ FfiConverterInt64.write(value.stateDefault, into: &buf)
11501
+ FfiConverterInt64.write(value.usersDefault, into: &buf)
11502
+ FfiConverterInt64.write(value.roomName, into: &buf)
11503
+ FfiConverterInt64.write(value.roomAvatar, into: &buf)
11504
+ FfiConverterInt64.write(value.roomTopic, into: &buf)
11505
+ }
11506
+ }
11507
+
11508
+
11509
+ public func FfiConverterTypeRoomPowerLevels_lift(_ buf: RustBuffer) throws -> RoomPowerLevels {
11510
+ return try FfiConverterTypeRoomPowerLevels.lift(buf)
11511
+ }
11512
+
11513
+ public func FfiConverterTypeRoomPowerLevels_lower(_ value: RoomPowerLevels) -> RustBuffer {
11514
+ return FfiConverterTypeRoomPowerLevels.lower(value)
11515
+ }
11516
+
11517
+
11310
11518
public struct RoomSubscription {
11311
11519
public var requiredState: [RequiredState]?
11312
11520
public var timelineLimit: UInt32?
@@ -22385,9 +22593,6 @@ private var initializationResult: InitializationResult {
22385
22593
if (uniffi_matrix_sdk_ffi_checksum_method_room_ban_user() != 25865) {
22386
22594
return InitializationResult.apiChecksumMismatch
22387
22595
}
22388
- if (uniffi_matrix_sdk_ffi_checksum_method_room_build_power_level_changes_from_current() != 13995) {
22389
- return InitializationResult.apiChecksumMismatch
22390
- }
22391
22596
if (uniffi_matrix_sdk_ffi_checksum_method_room_can_user_ban() != 22009) {
22392
22597
return InitializationResult.apiChecksumMismatch
22393
22598
}
@@ -22421,6 +22626,9 @@ private var initializationResult: InitializationResult {
22421
22626
if (uniffi_matrix_sdk_ffi_checksum_method_room_display_name() != 39695) {
22422
22627
return InitializationResult.apiChecksumMismatch
22423
22628
}
22629
+ if (uniffi_matrix_sdk_ffi_checksum_method_room_get_power_levels() != 54094) {
22630
+ return InitializationResult.apiChecksumMismatch
22631
+ }
22424
22632
if (uniffi_matrix_sdk_ffi_checksum_method_room_has_active_room_call() != 33588) {
22425
22633
return InitializationResult.apiChecksumMismatch
22426
22634
}
@@ -22502,6 +22710,9 @@ private var initializationResult: InitializationResult {
22502
22710
if (uniffi_matrix_sdk_ffi_checksum_method_room_report_content() != 39574) {
22503
22711
return InitializationResult.apiChecksumMismatch
22504
22712
}
22713
+ if (uniffi_matrix_sdk_ffi_checksum_method_room_reset_power_levels() != 63622) {
22714
+ return InitializationResult.apiChecksumMismatch
22715
+ }
22505
22716
if (uniffi_matrix_sdk_ffi_checksum_method_room_room_info() != 41146) {
22506
22717
return InitializationResult.apiChecksumMismatch
22507
22718
}
0 commit comments