mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-15 11:36:07 -04:00
ffi: Remove remaining callback interfaces from UDL
This commit is contained in:
committed by
Jonas Platte
parent
899c0d59e6
commit
12df1f38ed
@@ -1,26 +1,5 @@
|
||||
namespace matrix_sdk_ffi {};
|
||||
|
||||
callback interface ClientDelegate {
|
||||
void did_receive_auth_error(boolean is_soft_logout);
|
||||
};
|
||||
|
||||
callback interface NotificationDelegate {
|
||||
void did_receive_notification(NotificationItem notification);
|
||||
};
|
||||
|
||||
dictionary NotificationItem {
|
||||
TimelineEvent event;
|
||||
string room_id;
|
||||
string? sender_display_name;
|
||||
string? sender_avatar_url;
|
||||
string room_display_name;
|
||||
string? room_avatar_url;
|
||||
string? room_canonical_alias;
|
||||
boolean is_noisy;
|
||||
boolean is_direct;
|
||||
boolean? is_encrypted;
|
||||
};
|
||||
|
||||
interface TimelineEvent {};
|
||||
|
||||
enum SlidingSyncState {
|
||||
|
||||
@@ -36,7 +36,7 @@ use tracing::{debug, error, warn};
|
||||
use url::Url;
|
||||
|
||||
use super::{room::Room, session_verification::SessionVerificationController, RUNTIME};
|
||||
use crate::{client, ClientError, NotificationItem};
|
||||
use crate::{client, notification::NotificationItem, ClientError};
|
||||
|
||||
#[derive(Clone, uniffi::Record)]
|
||||
pub struct PusherIdentifiers {
|
||||
@@ -98,10 +98,12 @@ impl From<PushFormat> for RumaPushFormat {
|
||||
}
|
||||
}
|
||||
|
||||
#[uniffi::export(callback_interface)]
|
||||
pub trait ClientDelegate: Sync + Send {
|
||||
fn did_receive_auth_error(&self, is_soft_logout: bool);
|
||||
}
|
||||
|
||||
#[uniffi::export(callback_interface)]
|
||||
pub trait NotificationDelegate: Sync + Send {
|
||||
fn did_receive_notification(&self, notification: NotificationItem);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ use matrix_sdk::{
|
||||
};
|
||||
|
||||
use self::{
|
||||
client::*, error::ClientError, event::*, notification::*, platform::*, session_verification::*,
|
||||
client::*, error::ClientError, event::*, platform::*, session_verification::*,
|
||||
task_handle::TaskHandle, timeline::MediaSourceExt,
|
||||
};
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ use ruma::{
|
||||
|
||||
use crate::event::TimelineEvent;
|
||||
|
||||
#[derive(uniffi::Record)]
|
||||
pub struct NotificationItem {
|
||||
pub event: Arc<TimelineEvent>,
|
||||
pub room_id: String,
|
||||
|
||||
Reference in New Issue
Block a user