Nostr library update and subscription improvement
This commit is contained in:
parent
87b22e5851
commit
60593de785
2 changed files with 8 additions and 3 deletions
|
@ -41,7 +41,7 @@ lib_deps =
|
||||||
https://github.com/dsbaars/universal_pin
|
https://github.com/dsbaars/universal_pin
|
||||||
https://github.com/dsbaars/GxEPD2#universal_pin
|
https://github.com/dsbaars/GxEPD2#universal_pin
|
||||||
https://github.com/tzapu/WiFiManager.git#v2.0.17
|
https://github.com/tzapu/WiFiManager.git#v2.0.17
|
||||||
rblb/Nostrduino@^1.2.5
|
rblb/Nostrduino@^1.2.7
|
||||||
|
|
||||||
[env:lolin_s3_mini]
|
[env:lolin_s3_mini]
|
||||||
extends = btclock_base
|
extends = btclock_base
|
||||||
|
|
|
@ -7,8 +7,12 @@ TaskHandle_t nostrTaskHandle = NULL;
|
||||||
void setupNostrNotify()
|
void setupNostrNotify()
|
||||||
{
|
{
|
||||||
nostr::esp32::ESP32Platform::initNostr(false);
|
nostr::esp32::ESP32Platform::initNostr(false);
|
||||||
|
time_t now;
|
||||||
|
time(&now);
|
||||||
|
struct tm* utcTimeInfo;
|
||||||
|
utcTimeInfo = gmtime(&now);
|
||||||
|
time_t utcNow = mktime(utcTimeInfo);
|
||||||
|
time_t timestamp60MinutesAgo = utcNow - 3600;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -23,6 +27,7 @@ void setupNostrNotify()
|
||||||
{{// we set the filters here (see
|
{{// we set the filters here (see
|
||||||
// https://github.com/nostr-protocol/nips/blob/master/01.md#from-client-to-relay-sending-events-and-creating-subscriptions)
|
// https://github.com/nostr-protocol/nips/blob/master/01.md#from-client-to-relay-sending-events-and-creating-subscriptions)
|
||||||
{"kinds", {"1"}},
|
{"kinds", {"1"}},
|
||||||
|
{"since", {String(timestamp60MinutesAgo)}},
|
||||||
{"authors", {pubKey}}}},
|
{"authors", {pubKey}}}},
|
||||||
[&](const String &subId, nostr::SignedNostrEvent *event)
|
[&](const String &subId, nostr::SignedNostrEvent *event)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue