Compare commits
3 Commits
49015f3263
...
ab2cc085a3
Author | SHA1 | Date | |
---|---|---|---|
ab2cc085a3 | |||
2ef5390bc8 | |||
8da6efb9d5 |
@ -43,7 +43,8 @@ host=wss://your-xmpp-server
|
|||||||
user=your_xmpp_username
|
user=your_xmpp_username
|
||||||
domain=your_xmpp_domain
|
domain=your_xmpp_domain
|
||||||
password=your_xmpp_password
|
password=your_xmpp_password
|
||||||
resource=bot
|
; optional (will default to nostrsms-bot)
|
||||||
|
resource=nostrsms-bot
|
||||||
|
|
||||||
[relays]
|
[relays]
|
||||||
read=wss://relay.example.com
|
read=wss://relay.example.com
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
domain =
|
domain =
|
||||||
host =
|
host =
|
||||||
password =
|
password =
|
||||||
|
# optional (will default to nostrsms-bot)
|
||||||
resource =
|
resource =
|
||||||
user =
|
user =
|
||||||
|
|
||||||
|
5
index.js
5
index.js
@ -46,7 +46,7 @@ if (fs.existsSync(configPath)) {
|
|||||||
const xmpp = client({
|
const xmpp = client({
|
||||||
service: config.xmpp.host,
|
service: config.xmpp.host,
|
||||||
domain: config.xmpp.domain,
|
domain: config.xmpp.domain,
|
||||||
resource: config.xmpp.resource || 'bot',
|
resource: config.xmpp.resource || 'nostrsms-bot',
|
||||||
username: config.xmpp.user,
|
username: config.xmpp.user,
|
||||||
password: config.xmpp.password,
|
password: config.xmpp.password,
|
||||||
});
|
});
|
||||||
@ -70,7 +70,8 @@ if (fs.existsSync(configPath)) {
|
|||||||
// check for chat messages
|
// check for chat messages
|
||||||
if (stanza.is('message') && stanza.attrs.type === 'chat') {
|
if (stanza.is('message') && stanza.attrs.type === 'chat') {
|
||||||
// store from jid, and message contents
|
// store from jid, and message contents
|
||||||
const from = stanza.attrs.from;
|
const rawfrom = stanza.attrs.from;
|
||||||
|
const from = rawfrom.split('/')[0];
|
||||||
const body = stanza.getChildText('body');
|
const body = stanza.getChildText('body');
|
||||||
|
|
||||||
// show them to the user in console
|
// show them to the user in console
|
||||||
|
Loading…
x
Reference in New Issue
Block a user