- printfd(__FILE__, "DelMessage\n");
- store->DelMessage(it->header.id, login);
- messages.erase(it++);
+ if (SendMessage(*it))
+ {
+ return -1;
+ }
+ it->header.repeat--;
+ if (it->header.repeat < 0)
+ {
+ if (store->DelMessage(it->header.id, login))
+ {
+ WriteServLog("Error deleting message: '%s'", store->GetStrError().c_str());
+ printfd(__FILE__, "Error deleting message: '%s'\n", store->GetStrError().c_str());
+ }
+ messages.erase(it++);
+ }
+ else
+ {
+ #ifndef DEBUG
+ //TODO: gcc v. 4.x generate ICE on x86_64
+ it->header.lastSendTime = time(NULL);
+ #else
+ it->header.lastSendTime = stgTime;
+ #endif
+ if (store->EditMessage(*it, login))
+ {
+ WriteServLog("Error modifying message: '%s'", store->GetStrError().c_str());
+ printfd(__FILE__, "Error modifying message: '%s'\n", store->GetStrError().c_str());
+ }
+ ++it;
+ }