-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
-
-/*vector<STG_MSG_HDR> hdrsList;
-
-if (store->GetMessageHdrs(&hdrsList, login))
- {
- printfd(__FILE__, "Error GetMessageHdrs %s\n", store->GetStrError().c_str());
- return -1;
- }
-
-for (unsigned i = 0; i < hdrsList.size(); i++)
- {
-
- if (hdrsList[i].lastSendTime + hdrsList[i].repeatPeriod * 60 < (unsigned)stgTime)
- {
- STG_MSG msg;
- if (store->GetMessage(hdrsList[i].id, &msg, login) == 0)
- {
- if (SendMessage(msg) == 0)
- {
- msg.header.repeat--;
- if (msg.header.repeat < 0)
- {
- printfd(__FILE__, "DelMessage\n");
- store->DelMessage(hdrsList[i].id, login);
- }
- else
- {
- #ifndef DEBUG
- //TODO: gcc v. 4.x generate ICE on x86_64
- msg.header.lastSendTime = time(NULL);
- #else
- msg.header.lastSendTime = stgTime;
- #endif
- if (store->EditMessage(msg, login))
- {
- printfd(__FILE__, "EditMessage Error %s\n", store->GetStrError().c_str());
- }
- }
- }
- }
- else
- {
- WriteServLog("Cannot get message for user %s.", login.c_str());
- WriteServLog("%s", store->GetStrError().c_str());
- }
- }
- }*/