/// <summary> /// MessageStatus event handler which receives notifications from IMAP server. Learns about new messages in idling state /// </summary> private void _imap_MessageStatus(object sender, ImapMessageStatusEventArgs e) { // RECENT status means new messages have just arrived to IMAP account. Initiate stopping idle and IdleCallback will download the messages if ("RECENT" == e.StatusID) { _imap.StopIdle(); } }
} // imp_Idling /// <summary> /// MessageStatus event handler which receives notifications from IMAP server. Learns about new messages in idling state /// </summary> private void imp_MessageStatus(object sender, ImapMessageStatusEventArgs e) { try { Info("Got {0} status update", e.StatusID); // RECENT status means new messages have just arrived to IMAP account. Initiate stopping idle and IdleCallback will download the messages if ("RECENT" == e.StatusID || "EXISTS" == e.StatusID) { imp.StopIdle(); Info("Initiated stopping idle"); } // if } catch (Exception ex) { Error("Error occured while in imp_MessageStatus:{0}", ex); Info("Trying to reconnect to mailbox"); SafeDispose(); ConnectToMailboxLoop(); } // try } // imp_MessageStatus