Skip to content

Commit

Permalink
Update policy.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
BlowaterNostr committed May 14, 2024
1 parent 42f5a5c commit 7f61428
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions resolvers/policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,22 @@ export class PolicyStore {
// generate new relay member list
if (this.args.db) {
if (args.kind == NostrKind.TEXT_NOTE) {
const event = await sign_event_v2(this.args.system_account, {
pubkey: this.args.system_account.toPublicKey().hex,
kind: Kind_V2.RelayMember,
members: Array.from(policy.allow),
created_at: Date.now(),
});
// warn: could throw
try {
this.args.db.query(
`INSERT INTO events_v2 (id, pubkey, kind, event) VALUES (?, ?, ?, ?);`,
[event.id, event.pubkey, event.kind, JSON.stringify(event)],
);
} catch (e) {
console.log(event);
console.error(e);
}
// const event = await sign_event_v2(this.args.system_account, {
// pubkey: this.args.system_account.toPublicKey().hex,
// kind: Kind_V2.RelayMember,
// members: Array.from(policy.allow),
// created_at: Date.now(),
// });
// // warn: could throw
// try {
// this.args.db.query(
// `INSERT INTO events_v2 (id, pubkey, kind, event) VALUES (?, ?, ?, ?);`,
// [event.id, event.pubkey, event.kind, JSON.stringify(event)],
// );
// } catch (e) {
// console.log(event);
// console.error(e);
// }
}
} else {
console.log("Feature Not Supported in this environment: Relay Members");
Expand Down

0 comments on commit 7f61428

Please sign in to comment.