Implements attachment uploading
This commit is contained in:
@@ -13,5 +13,6 @@ pub mod interface {
|
||||
pub use crate::interface::NetBuzzertKordophoneRepositoryConversationsUpdated as ConversationsUpdated;
|
||||
pub use crate::interface::NetBuzzertKordophoneRepositoryMessagesUpdated as MessagesUpdated;
|
||||
pub use crate::interface::NetBuzzertKordophoneRepositoryAttachmentDownloadCompleted as AttachmentDownloadCompleted;
|
||||
pub use crate::interface::NetBuzzertKordophoneRepositoryAttachmentUploadCompleted as AttachmentUploadCompleted;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,6 +264,16 @@ impl DbusRepository for ServerImpl {
|
||||
// For now, just trigger the download event - we'll implement the actual download logic later
|
||||
self.send_event_sync(|r| Event::DownloadAttachment(attachment_id, preview, r))
|
||||
}
|
||||
|
||||
fn upload_attachment(
|
||||
&mut self,
|
||||
path: String,
|
||||
) -> Result<String, dbus::MethodErr> {
|
||||
use std::path::PathBuf;
|
||||
|
||||
let path = PathBuf::from(path);
|
||||
self.send_event_sync(|r| Event::UploadAttachment(path, r))
|
||||
}
|
||||
}
|
||||
|
||||
impl DbusSettings for ServerImpl {
|
||||
|
||||
Reference in New Issue
Block a user