mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-30 22:22:02 +02:00
OAuth 2 (#158)
This commit is contained in:
@@ -26,6 +26,10 @@ impl PluginHandle {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn name(&self) -> String {
|
||||
self.boot_resp.lock().await.name.clone()
|
||||
}
|
||||
|
||||
pub async fn info(&self) -> BootResponse {
|
||||
let resp = &*self.boot_resp.lock().await;
|
||||
resp.clone()
|
||||
@@ -33,7 +37,7 @@ impl PluginHandle {
|
||||
|
||||
pub fn build_event_to_send(
|
||||
&self,
|
||||
window_context: WindowContext,
|
||||
window_context: &WindowContext,
|
||||
payload: &InternalEventPayload,
|
||||
reply_id: Option<String>,
|
||||
) -> InternalEvent {
|
||||
@@ -42,7 +46,7 @@ impl PluginHandle {
|
||||
|
||||
pub(crate) fn build_event_to_send_raw(
|
||||
&self,
|
||||
window_context: WindowContext,
|
||||
window_context: &WindowContext,
|
||||
payload: &InternalEventPayload,
|
||||
reply_id: Option<String>,
|
||||
) -> InternalEvent {
|
||||
@@ -53,18 +57,18 @@ impl PluginHandle {
|
||||
plugin_name: dir.file_name().unwrap().to_str().unwrap().to_string(),
|
||||
reply_id,
|
||||
payload: payload.clone(),
|
||||
window_context,
|
||||
window_context: window_context.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn terminate(&self, window_context: WindowContext) -> Result<()> {
|
||||
pub async fn terminate(&self, window_context: &WindowContext) -> Result<()> {
|
||||
info!("Terminating plugin {}", self.dir);
|
||||
let event =
|
||||
self.build_event_to_send(window_context, &InternalEventPayload::TerminateRequest, None);
|
||||
self.send(&event).await
|
||||
}
|
||||
|
||||
pub(crate) async fn send(&self, event: &InternalEvent) -> Result<()> {
|
||||
pub async fn send(&self, event: &InternalEvent) -> Result<()> {
|
||||
self.to_plugin_tx.lock().await.send(event.to_owned()).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user