Skip to content

Commit

Permalink
use namespaces instead of using specific variables
Browse files Browse the repository at this point in the history
  • Loading branch information
finrodfelagund97 committed Apr 16, 2024
1 parent ae20acb commit 2c9956c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 44 deletions.
16 changes: 2 additions & 14 deletions src/event.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
#include <ctime>
#include <openssl/evp.h>
#include <iomanip>
#include <sstream>
#include <string>
#include <nlohmann/json.hpp>
#include <openssl/sha.h>

#include "nostr.hpp"

using nlohmann::json;
using std::hex;
using std::invalid_argument;
using std::make_shared;
using std::ostringstream;
using std::setw;
using std::setfill;
using std::shared_ptr;
using std::string;
using std::stringstream;
using std::time;
using namespace nlohmann;
using namespace std;

namespace nostr
{
Expand Down
10 changes: 2 additions & 8 deletions src/filters.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
#include <ctime>
#include <sstream>
#include <string>
#include <nlohmann/json.hpp>

#include "nostr.hpp"
using namespace nlohmann;
using namespace std;

using nlohmann::json;
using std::invalid_argument;
using std::stringstream;
using std::string;
using std::time;

namespace nostr
{
Expand Down
27 changes: 5 additions & 22 deletions src/nostr_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,9 @@
#include "nostr.hpp"
#include "client/web_socket_client.hpp"

using nlohmann::json;
using std::async;
using std::exception;
using std::find_if;
using std::function;
using std::future;
using std::invalid_argument;
using std::lock_guard;
using std::make_shared;
using std::make_tuple;
using std::move;
using std::mutex;
using std::out_of_range;
using std::promise;
using std::shared_ptr;
using std::string;
using std::thread;
using std::tuple;
using std::unique_ptr;
using std::vector;
using namespace nlohmann;
using namespace std;
using namespace UUIDv4;

namespace nostr
{
Expand Down Expand Up @@ -513,8 +496,8 @@ void NostrService::disconnect(string relay)

string NostrService::generateSubscriptionId()
{
UUIDv4::UUIDGenerator<std::mt19937_64> uuidGenerator;
UUIDv4::UUID uuid = uuidGenerator.getUUID();
UUIDGenerator<std::mt19937_64> uuidGenerator;
UUID uuid = uuidGenerator.getUUID();
return uuid.bytes();
};

Expand Down

0 comments on commit 2c9956c

Please sign in to comment.