diff options
author | George Hazan <george.hazan@gmail.com> | 2014-11-16 18:15:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-11-16 18:15:16 +0000 |
commit | 8a59f88f48312eb877347a233b0a6ec11c9ab550 (patch) | |
tree | 8c9724efe668b5744bd37fe6ae3b45330a53b742 /protocols/MSN/src/msn_msgqueue.cpp | |
parent | 8148930684c823e526ab8092b33c129a8b17db74 (diff) |
MSN protocol's death-scream
git-svn-id: http://svn.miranda-ng.org/main/trunk@10998 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN/src/msn_msgqueue.cpp')
-rw-r--r-- | protocols/MSN/src/msn_msgqueue.cpp | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/protocols/MSN/src/msn_msgqueue.cpp b/protocols/MSN/src/msn_msgqueue.cpp index c11887c53d..3edfa0cbbf 100644 --- a/protocols/MSN/src/msn_msgqueue.cpp +++ b/protocols/MSN/src/msn_msgqueue.cpp @@ -68,7 +68,7 @@ const char* CMsnProto::MsgQueue_CheckContact(const char* wlid, time_t tsc) mir_cslock lck(csMsgQueue);
- for (int i=0; i < lsMessageQueue.getCount(); i++)
+ for (int i = 0; i < lsMessageQueue.getCount(); i++)
if (_stricmp(lsMessageQueue[i].wlid, wlid) == 0 && (tsc == 0 || (ts - lsMessageQueue[i].ts) < tsc))
return wlid;
@@ -80,15 +80,13 @@ const char* CMsnProto::MsgQueue_GetNextRecipient(void) {
mir_cslock lck(csMsgQueue);
- for (int i=0; i < lsMessageQueue.getCount(); i++)
- {
+ for (int i = 0; i < lsMessageQueue.getCount(); i++) {
MsgQueueEntry& E = lsMessageQueue[i];
- if (!E.allocatedToThread)
- {
+ if (!E.allocatedToThread) {
E.allocatedToThread = 1;
const char *ret = E.wlid;
- while(++i < lsMessageQueue.getCount())
+ while (++i < lsMessageQueue.getCount())
if (_stricmp(lsMessageQueue[i].wlid, ret) == 0)
lsMessageQueue[i].allocatedToThread = 1;
@@ -110,8 +108,7 @@ bool CMsnProto::MsgQueue_GetNext(const char* wlid, MsgQueueEntry& retVal) break;
bool res = i != lsMessageQueue.getCount();
- if (res)
- {
+ if (res) {
retVal = lsMessageQueue[i];
lsMessageQueue.remove(i);
}
@@ -124,7 +121,7 @@ int CMsnProto::MsgQueue_NumMsg(const char* wlid) int res = 0;
mir_cslock lck(csMsgQueue);
- for(int i=0; i < lsMessageQueue.getCount(); i++)
+ for (int i = 0; i < lsMessageQueue.getCount(); i++)
res += (_stricmp(lsMessageQueue[i].wlid, wlid) == 0);
return res;
@@ -135,13 +132,10 @@ void CMsnProto::MsgQueue_Clear(const char* wlid, bool msg) int i;
mir_cslockfull lck(csMsgQueue);
- if (wlid == NULL)
- {
- for(i=0; i < lsMessageQueue.getCount(); i++)
- {
+ if (wlid == NULL) {
+ for (i = 0; i < lsMessageQueue.getCount(); i++) {
const MsgQueueEntry& E = lsMessageQueue[i];
- if (E.msgSize == 0)
- {
+ if (E.msgSize == 0) {
MCONTACT hContact = MSN_HContactFromEmail(E.wlid);
ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED,
(HANDLE)E.seq, (LPARAM)Translate("Message delivery failed"));
@@ -154,14 +148,11 @@ void CMsnProto::MsgQueue_Clear(const char* wlid, bool msg) msgQueueSeq = 1;
}
- else
- {
- for(i=0; i < lsMessageQueue.getCount(); i++)
- {
+ else {
+ for (i = 0; i < lsMessageQueue.getCount(); i++) {
time_t ts = time(NULL);
const MsgQueueEntry& E = lsMessageQueue[i];
- if (_stricmp(lsMessageQueue[i].wlid, wlid) == 0 && (!msg || E.msgSize == 0))
- {
+ if (_stricmp(lsMessageQueue[i].wlid, wlid) == 0 && (!msg || E.msgSize == 0)) {
bool msgfnd = E.msgSize == 0 && E.ts < ts;
int seq = E.seq;
|