+ }*/
+
+std::list<STG_MSG>::iterator it(messages.begin());
+while (it != messages.end())
+ {
+ if (SendMessage(*it))
+ {
+ break;
+ }
+ it->header.repeat--;
+ if (it->header.repeat < 0)
+ {
+ printfd(__FILE__, "DelMessage\n");
+ store->DelMessage(it->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;
+ }