Cleanup recordings

This commit is contained in:
2024-02-27 21:43:37 +00:00
parent 103963f81f
commit 6003534272
16 changed files with 646 additions and 16 deletions

View File

@ -102,8 +102,24 @@ public class StreamEventBuilder
return ev.Sign(pk);
}
public NostrEvent CreateDm(UserStream stream, string message)
{
var pk = NostrPrivateKey.FromBech32(_config.PrivateKey);
var ev = new NostrEvent
{
Kind = NostrKind.EncryptedDm,
Content = message,
CreatedAt = DateTime.Now,
Tags = new NostrEventTags(
new NostrEventTag("p", stream.PubKey)
)
};
return ev.EncryptDirect(pk, NostrPublicKey.FromHex(stream.PubKey)).Sign(pk);
}
public void BroadcastEvent(NostrEvent ev)
{
_nostrClient.Send(new NostrEventRequest(ev));
}
}
}