Removing NIP-26, as it's been deprecated

will be replacing with kind 30078
This commit is contained in:
Stephen Vanderwarker 2024-08-11 13:30:17 -04:00
parent b27fcf8308
commit ee0cea8d9f

View File

@ -1,5 +1,4 @@
// initialize required packages
const sqlite3 = require('sqlite3');
const fs = require('fs');
const ini = require('ini');
const nostr = require('nostr-tools');
@ -7,8 +6,6 @@ const wspf = require('websocket-polyfill');
const WebSocket = require('ws');
const xmpp = require('simple-xmpp');
var db = new sqlite3.Database('nip26.db');
let {
bech32,
bech32m
@ -48,8 +45,8 @@ if (fs.existsSync('./config.ini')) {
let sub = relay.sub([{
kinds: [1],
authors: [pk],
limit: 5
// authors: [pk],
limit: 10
}, ])
sub.on('event', event => {
console.log('got event:', event);
@ -81,14 +78,7 @@ if (fs.existsSync('./config.ini')) {
xmpp.send(from, 'https://wiki.vanderwarker.family/doku.php?id=code:nostrsms:commands');
debug();
} else if (message === "!auth") {
xmpp.send(from, "reauth (nip-26)");
const now = new Date();
const validUntil = now.getTime() + (30 * 24 * 60 * 60 * 1000);
const insertStmt = db.prepare('INSERT INTO users (pnum, token) VALUES (?, ?)');
insertStmt.run(from.split("@")[0], validUntil);
insertStmt.finalize();
debug();
xmpp.send(from, "https://auth.nostrsms.com");
} else {
async function newPost() {
const relay = nostr.relayInit(config.relays.write, WebSocket);
@ -151,4 +141,4 @@ if (fs.existsSync('./config.ini')) {
console.log("Please create a config.ini");
console.log("See https://wiki.vanderwarker.family/doku.php?id=code:nostrsms:install");
console.log("and choose your preferred install method.");
}
}