Search added, but change window and back lets app crash
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <map>
|
||||
#include <list>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <Wt/WServer.h>
|
||||
#include <Wt/WDate.h>
|
||||
#include <Wt/Json/Object.h>
|
||||
@@ -49,16 +50,19 @@ public:
|
||||
Wt::WString message;
|
||||
Wt::Json::Object image;
|
||||
Wt::Json::Object json();
|
||||
void setNewSesionId(std::string oldSessionId, std::string newSessionId);
|
||||
};
|
||||
struct MessageQueue {
|
||||
bool user1Read{false};
|
||||
bool user2Read{false};
|
||||
std::vector<Message> messages;
|
||||
void setNewSesionId(std::string oldSessionId, std::string newSessionId);
|
||||
};
|
||||
Broadcast(Wt::WServer *server);
|
||||
~Broadcast();
|
||||
void connect(Client *client, const std::function<void ()> &fct);
|
||||
void disconnect(Client *client);
|
||||
Wt::Json::Object reSetUser(std::string oldSessionId, std::string newSessionId);
|
||||
int count() const;
|
||||
std::string userNameForSessionId(std::string sessionId);
|
||||
std::string sessionIdForUserName(std::string userName);
|
||||
@@ -78,6 +82,8 @@ public:
|
||||
void sendUserInformation(std::string sendToSessionId, std::string userName, std::string requestingUserName);
|
||||
void toggleBlockUser(std::string blockingUserName, std::string blockedUser, std::string blockingUserSessionId);
|
||||
void requestConversation(std::string sendToSessionId, std::string withUserName, std::string requestingUserName);
|
||||
void userSearch(std::string toSession, std::string nameIncludes, int minAge, int maxAge,
|
||||
std::unordered_set<std::string> countries, std::unordered_set<std::string> genders, std::string excludeName);
|
||||
protected:
|
||||
struct Connection {
|
||||
Connection(const std::string &id, Client *client, const std::function<void ()> &fct);
|
||||
@@ -93,6 +99,7 @@ protected:
|
||||
void addBroadcast(Wt::Json::Object broadcast);
|
||||
std::list<Wt::Json::Object> getBroadcasts(bool clear = false);
|
||||
std::unordered_map<std::string, std::vector<std::string> > blockings_;
|
||||
bool setSessionId(std::string searchedSessionId, std::string newSessionId);
|
||||
private:
|
||||
std::string sessionId_;
|
||||
Client *client_;
|
||||
@@ -118,6 +125,7 @@ private:
|
||||
Wt::Json::Object logoutBroadcast();
|
||||
static size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* output);
|
||||
bool parseCountriesData();
|
||||
void reSetSessionIdInMessages(std::string oldSessionId, std::string newSessionId);
|
||||
Wt::Json::Object createUserList();
|
||||
void sendMessageQueueToSession(std::string receiverSessionId, std::string user1, std::string user2, std::vector<Message> messages);
|
||||
void addMessageToSessionBroadcast(std::string sessionId, Wt::Json::Object message);
|
||||
|
||||
Reference in New Issue
Block a user