forked from btclock/btclock_v3
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/GxEPD2#universal_pin
|
||||
https://github.com/tzapu/WiFiManager.git#v2.0.17
|
||||
rblb/Nostrduino@^1.2.5
|
||||
rblb/Nostrduino@^1.2.7
|
||||
|
||||
[env:lolin_s3_mini]
|
||||
extends = btclock_base
|
||||
|
|
|
@ -7,8 +7,12 @@ TaskHandle_t nostrTaskHandle = NULL;
|
|||
void setupNostrNotify()
|
||||
{
|
||||
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
|
||||
{
|
||||
|
@ -23,6 +27,7 @@ void setupNostrNotify()
|
|||
{{// 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)
|
||||
{"kinds", {"1"}},
|
||||
{"since", {String(timestamp60MinutesAgo)}},
|
||||
{"authors", {pubKey}}}},
|
||||
[&](const String &subId, nostr::SignedNostrEvent *event)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue