1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 18:45:10 +00:00

Fix IMAP IDLE with Google's IMAP service.

This commit is contained in:
Brenden Matthews 2009-09-26 18:38:07 -07:00
parent 28978461a7
commit 4a0676d4d0

View File

@ -523,6 +523,15 @@ void *imap_thread(void *arg)
fail++; fail++;
break; break;
} }
strncpy(sendbuf, "abc CAPABILITY\r\n", MAXDATASIZE);
if (imap_command(sockfd, sendbuf, recvbuf, "abc OK")) {
fail++;
break;
}
if (strstr(recvbuf, " IDLE ") != NULL) {
has_idle = 1;
}
strncpy(sendbuf, "a1 login ", MAXDATASIZE); strncpy(sendbuf, "a1 login ", MAXDATASIZE);
strncat(sendbuf, mail->user, MAXDATASIZE - strlen(sendbuf) - 1); strncat(sendbuf, mail->user, MAXDATASIZE - strlen(sendbuf) - 1);
strncat(sendbuf, " ", MAXDATASIZE - strlen(sendbuf) - 1); strncat(sendbuf, " ", MAXDATASIZE - strlen(sendbuf) - 1);
@ -532,9 +541,6 @@ void *imap_thread(void *arg)
fail++; fail++;
break; break;
} }
if (strstr(recvbuf, " IDLE ") != NULL) {
has_idle = 1;
}
strncpy(sendbuf, "a2 STATUS ", MAXDATASIZE); strncpy(sendbuf, "a2 STATUS ", MAXDATASIZE);
strncat(sendbuf, mail->folder, MAXDATASIZE - strlen(sendbuf) - 1); strncat(sendbuf, mail->folder, MAXDATASIZE - strlen(sendbuf) - 1);