mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-17 13:22:56 +01:00
revert "a function to send an event directly to a specific connection."
this reverts commit e9c9d0c3a7b6ace94cd40e04d74e4ffd31b6b898 because it is not a good idea and probably useless.
This commit is contained in:
parent
9069341657
commit
d4334ac2bb
@ -140,7 +140,7 @@ func (rl *Relay) notifyListeners(event *nostr.Event) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
listener.ws.SendEvent(listener.id, *event)
|
listener.ws.WriteJSON(nostr.EventEnvelope{SubscriptionID: &listener.id, Event: *event})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/fasthttp/websocket"
|
"github.com/fasthttp/websocket"
|
||||||
"github.com/nbd-wtf/go-nostr"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type WebSocket struct {
|
type WebSocket struct {
|
||||||
@ -39,10 +38,3 @@ func (ws *WebSocket) WriteMessage(t int, b []byte) error {
|
|||||||
defer ws.mutex.Unlock()
|
defer ws.mutex.Unlock()
|
||||||
return ws.conn.WriteMessage(t, b)
|
return ws.conn.WriteMessage(t, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ws *WebSocket) SendEvent(subscriptionId string, event nostr.Event) error {
|
|
||||||
return ws.WriteJSON(nostr.EventEnvelope{
|
|
||||||
SubscriptionID: &subscriptionId,
|
|
||||||
Event: event,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user