diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-09-04 16:44:43 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-09-04 17:01:07 +0100 |
| commit | c4c262a5e9bfeb30bc0106d9ea51dfce7e4fa1f3 (patch) | |
| tree | d02ba9ab1d461147c6ae2ae5e98e785c553a999f /src/lib/client.rs | |
| parent | 90c53e2dc859b47615ebaa08199b7460615ce3e4 (diff) | |
refactor(remote): split into modules
to make it easier to read
Diffstat (limited to 'src/lib/client.rs')
| -rw-r--r-- | src/lib/client.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/client.rs b/src/lib/client.rs index ace880b..c29d4b9 100644 --- a/src/lib/client.rs +++ b/src/lib/client.rs | |||
| @@ -38,6 +38,7 @@ use nostr_sqlite::SQLiteDatabase; | |||
| 38 | 38 | ||
| 39 | use crate::{ | 39 | use crate::{ |
| 40 | get_dirs, | 40 | get_dirs, |
| 41 | git::{Repo, RepoActions}, | ||
| 41 | git_events::{ | 42 | git_events::{ |
| 42 | event_is_cover_letter, event_is_patch_set_root, event_is_revision_root, status_kinds, | 43 | event_is_cover_letter, event_is_patch_set_root, event_is_revision_root, status_kinds, |
| 43 | }, | 44 | }, |
| @@ -1572,6 +1573,17 @@ pub async fn get_all_proposal_patch_events_from_cache( | |||
| 1572 | .collect()) | 1573 | .collect()) |
| 1573 | } | 1574 | } |
| 1574 | 1575 | ||
| 1576 | pub async fn get_event_from_cache_by_id(git_repo: &Repo, event_id: &EventId) -> Result<Event> { | ||
| 1577 | Ok(get_events_from_cache( | ||
| 1578 | git_repo.get_path()?, | ||
| 1579 | vec![nostr::Filter::default().id(*event_id)], | ||
| 1580 | ) | ||
| 1581 | .await? | ||
| 1582 | .first() | ||
| 1583 | .context("cannot find event in cache")? | ||
| 1584 | .clone()) | ||
| 1585 | } | ||
| 1586 | |||
| 1575 | #[allow(clippy::module_name_repetitions)] | 1587 | #[allow(clippy::module_name_repetitions)] |
| 1576 | #[allow(clippy::too_many_lines)] | 1588 | #[allow(clippy::too_many_lines)] |
| 1577 | pub async fn send_events( | 1589 | pub async fn send_events( |