+ }*/
+
+std::list<STG_MSG>::iterator it(messages.begin());
+while (it != messages.end())
+ {
+ if (SendMessage(*it))
+ {
+ return -1;
+ }
+ it->header.repeat--;
+ if (it->header.repeat < 0)
+ {
+ printfd(__FILE__, "DelMessage\n");
+ store->DelMessage(it->header.id, login);
+ 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))
+ {
+ printfd(__FILE__, "EditMessage Error %s\n", store->GetStrError().c_str());
+ }
+ ++it;
+ }