webrtc
This commit is contained in:
@ -88,6 +88,8 @@ export interface SystemInterface {
|
||||
*/
|
||||
DisconnectRelay(address: string): void;
|
||||
|
||||
HandleEvent(ev: TaggedNostrEvent): void;
|
||||
|
||||
/**
|
||||
* Send an event to all permanent connections
|
||||
* @param ev Event to broadcast
|
||||
|
@ -387,10 +387,15 @@ export class NostrSystem extends EventEmitter<NostrSystemEvents> implements Syst
|
||||
return [];
|
||||
}
|
||||
|
||||
HandleEvent(ev: TaggedNostrEvent) {
|
||||
this.#onEvent("*", ev);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send events to writable relays
|
||||
*/
|
||||
async BroadcastEvent(ev: NostrEvent, cb?: (rsp: OkResponse) => void) {
|
||||
this.HandleEvent({ ...ev, relays: [] });
|
||||
const socks = [...this.#sockets.values()].filter(a => !a.Ephemeral && a.Settings.write);
|
||||
const replyRelays = await pickRelaysForReply(ev, this);
|
||||
const oks = await Promise.all([
|
||||
|
@ -195,7 +195,7 @@ export class Query extends EventEmitter<QueryEvents> implements QueryBase {
|
||||
|
||||
handleEvent(sub: string, e: TaggedNostrEvent) {
|
||||
for (const t of this.#tracing) {
|
||||
if (t.id === sub) {
|
||||
if (t.id === sub || sub === "*") {
|
||||
if (t.filters.some(v => eventMatchesFilter(e, v))) {
|
||||
this.feed.add(e);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user