feat(NIP-28): replaceable kind 41 channel metadata events

This commit is contained in:
Greg Heartsfield
2022-12-24 10:14:43 -06:00
parent 4fd7643907
commit e5074f2e46
3 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -399,7 +399,7 @@ pub fn write_event(conn: &mut PooledConnection, e: &Event) -> Result<usize> {
// if this event is replaceable update, hide every other replaceable
// event with the same kind from the same author that was issued
// earlier than this.
if e.kind == 0 || e.kind == 3 || (e.kind >= 10000 && e.kind < 20000) {
if e.kind == 0 || e.kind == 3 || e.kind == 41 || (e.kind >= 10000 && e.kind < 20000) {
let update_count = tx.execute(
"UPDATE event SET hidden=TRUE WHERE id!=? AND kind=? AND author=? AND created_at <= ? and hidden!=TRUE",
params![ev_id, e.kind, hex::decode(&e.pubkey).ok(), e.created_at],
-1
View File
@@ -101,7 +101,6 @@ impl From<EventCmd> for Result<Event> {
}
impl Event {
#[cfg(test)]
pub fn simple_event() -> Event {
Event {