mirror of
https://github.com/nostrlabs-io/notepush.git
synced 2025-06-15 11:28:23 +00:00
fix: notify keys
This commit is contained in:
@ -598,6 +598,7 @@ ALTER TABLE user_info drop column dm_notifications_enabled;",
|
|||||||
.iter()
|
.iter()
|
||||||
.find(|t| {
|
.find(|t| {
|
||||||
t.kind() == TagKind::SingleLetter(SingleLetterTag::lowercase(Alphabet::P))
|
t.kind() == TagKind::SingleLetter(SingleLetterTag::lowercase(Alphabet::P))
|
||||||
|
&& t.as_vec().len() > 3
|
||||||
&& t.as_vec()[3] == "host"
|
&& t.as_vec()[3] == "host"
|
||||||
})
|
})
|
||||||
.and_then(|t| PublicKey::from_hex(t.content()?).ok())
|
.and_then(|t| PublicKey::from_hex(t.content()?).ok())
|
||||||
@ -697,7 +698,7 @@ ALTER TABLE user_info drop column dm_notifications_enabled;",
|
|||||||
let db_mutex_guard = self.db.lock().await;
|
let db_mutex_guard = self.db.lock().await;
|
||||||
let connection = db_mutex_guard.get()?;
|
let connection = db_mutex_guard.get()?;
|
||||||
let mut stmt =
|
let mut stmt =
|
||||||
connection.prepare("SELECT user_pubkey FROM notify_keys WHERE target_pubkey = ?")?;
|
connection.prepare("SELECT user_pubkey,kinds FROM notify_keys WHERE target_pubkey = ?")?;
|
||||||
let pubkeys = stmt
|
let pubkeys = stmt
|
||||||
.query_map([target.to_sql_string()], |row| {
|
.query_map([target.to_sql_string()], |row| {
|
||||||
let key = PublicKey::from_hex(row.get::<_, String>(0)?.as_str())
|
let key = PublicKey::from_hex(row.get::<_, String>(0)?.as_str())
|
||||||
|
Reference in New Issue
Block a user