feat: add action to compose modal

This commit is contained in:
reya
2025-01-21 15:15:37 +07:00
parent 5f6ba4f0a6
commit 582db29209
7 changed files with 265 additions and 172 deletions
+6
View File
@@ -1,6 +1,7 @@
use crate::{constants::NIP96_SERVER, get_client};
use chrono::{Datelike, Local, TimeZone};
use nostr_sdk::prelude::*;
use rnglib::{Language, RNG};
use std::{
collections::HashSet,
hash::{DefaultHasher, Hash, Hasher},
@@ -26,6 +27,11 @@ pub fn room_hash(tags: &Tags) -> u64 {
hasher.finish()
}
pub fn random_name(length: usize) -> String {
let rng = RNG::from(&Language::Roman);
rng.generate_names(length, true).join("-").to_lowercase()
}
pub fn compare<T>(a: &[T], b: &[T]) -> bool
where
T: Eq + Hash,