X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/8569ecdc2c9368dc0fe650b901cce7b37337ffec..90b793eb07dc190eeb1144a1da079de760d17c36:/projects/stargazer/plugins/store/firebird/firebird_store_messages.cpp diff --git a/projects/stargazer/plugins/store/firebird/firebird_store_messages.cpp b/projects/stargazer/plugins/store/firebird/firebird_store_messages.cpp index e14ad356..90c3e573 100644 --- a/projects/stargazer/plugins/store/firebird/firebird_store_messages.cpp +++ b/projects/stargazer/plugins/store/firebird/firebird_store_messages.cpp @@ -28,12 +28,15 @@ */ #include "firebird_store.h" + #include "stg/ibpp.h" +#include "stg/message.h" +#include "stg/common.h" //----------------------------------------------------------------------------- -int FIREBIRD_STORE::AddMessage(STG_MSG * msg, const std::string & login) const +int FIREBIRD_STORE::AddMessage(STG::Message * msg, const std::string & login) const { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr); IBPP::Statement st = IBPP::StatementFactory(db, tr); @@ -67,10 +70,10 @@ catch (IBPP::Exception & ex) return 0; } //----------------------------------------------------------------------------- -int FIREBIRD_STORE::EditMessage(const STG_MSG & msg, +int FIREBIRD_STORE::EditMessage(const STG::Message & msg, const std::string & login) const { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr); IBPP::Statement st = IBPP::StatementFactory(db, tr); @@ -105,10 +108,10 @@ return 0; } //----------------------------------------------------------------------------- int FIREBIRD_STORE::GetMessage(uint64_t id, - STG_MSG * msg, + STG::Message * msg, const std::string &) const { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amRead, til, tlr); IBPP::Statement st = IBPP::StatementFactory(db, tr); @@ -154,7 +157,7 @@ return 0; //----------------------------------------------------------------------------- int FIREBIRD_STORE::DelMessage(uint64_t id, const std::string &) const { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr); IBPP::Statement st = IBPP::StatementFactory(db, tr); @@ -179,15 +182,15 @@ catch (IBPP::Exception & ex) return 0; } //----------------------------------------------------------------------------- -int FIREBIRD_STORE::GetMessageHdrs(std::vector * hdrsList, +int FIREBIRD_STORE::GetMessageHdrs(std::vector * hdrsList, const std::string & login) const { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amRead, til, tlr); IBPP::Statement st = IBPP::StatementFactory(db, tr); -STG_MSG_HDR header; +STG::Message::Header header; try {