ffi: Remove remaining callback interfaces from UDL

This commit is contained in:
Jonas Platte
2023-06-15 11:23:45 +02:00
committed by Jonas Platte
parent 899c0d59e6
commit 12df1f38ed
4 changed files with 5 additions and 23 deletions

View File

@@ -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 {

View File

@@ -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);
}

View File

@@ -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,
};

View File

@@ -8,6 +8,7 @@ use ruma::{
use crate::event::TimelineEvent;
#[derive(uniffi::Record)]
pub struct NotificationItem {
pub event: Arc<TimelineEvent>,
pub room_id: String,