fix: regex, because it's always regex

This commit is contained in:
əlemi 2024-05-23 16:53:25 +02:00
parent b9a25bc3d7
commit a6227a6679
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -14,7 +14,8 @@ impl apb::server::Outbox for Context {
type Activity = serde_json::Value; type Activity = serde_json::Value;
async fn create_note(&self, uid: String, object: serde_json::Value) -> crate::Result<String> { async fn create_note(&self, uid: String, object: serde_json::Value) -> crate::Result<String> {
let re = regex::Regex::new(r"@(\w+)@(\w+)").expect("failed compiling regex pattern"); // TODO regex hell, here i come...
let re = regex::Regex::new(r"@(.+)@([^ ]+)").expect("failed compiling regex pattern");
let raw_oid = uuid::Uuid::new_v4().to_string(); let raw_oid = uuid::Uuid::new_v4().to_string();
let oid = self.oid(&raw_oid); let oid = self.oid(&raw_oid);
let aid = self.aid(&uuid::Uuid::new_v4().to_string()); let aid = self.aid(&uuid::Uuid::new_v4().to_string());