Пример #1
0
        /// <summary>
        /// Raises <b>Store</b> event.
        /// </summary>
        /// <param name="msgInfo">Message info.</param>
        /// <param name="setType">Flags set type.</param>
        /// <param name="flags">Flags.</param>
        /// <param name="response">Default IMAP server response.</param>
        /// <returns>Returns event args.</returns>
        private IMAP_e_Store OnStore(IMAP_MessageInfo msgInfo,IMAP_Flags_SetType setType,string[] flags,IMAP_r_ServerStatus response)
        {
            IMAP_e_Store eArgs = new IMAP_e_Store(m_pSelectedFolder.Folder,msgInfo,setType,flags,response);
            if(this.Store != null){
                this.Store(this,eArgs);
            }

            return eArgs;
        }
Пример #2
0
        private void m_pImapServer_Session_Store(object sender,IMAP_e_Store e)
        {
            try{
                IMAP_Session ses = (IMAP_Session)sender;

                List<string> flags = new List<string>();
                if(e.FlagsSetType == IMAP_Flags_SetType.Add){
                    flags.AddRange(IMAP_Utils.MessageFlagsAdd(e.MessageInfo.Flags,e.Flags));
                }
                else if(e.FlagsSetType == IMAP_Flags_SetType.Remove){
                    flags.AddRange(IMAP_Utils.MessageFlagsRemove(e.MessageInfo.Flags,e.Flags));
                }
                else{
                    flags.AddRange(e.Flags);
                }
                             
                m_pApi.StoreMessageFlags(
                    ses.AuthenticatedUserIdentity.Name,
                    ses.AuthenticatedUserIdentity.Name,
                    ses.SelectedFolderName,
                    e.MessageInfo,
                    flags.ToArray()
                );
            }
            catch(Exception x){
                e.Response = new IMAP_r_ServerStatus(e.Response.CommandTag,"NO","Error: " + x.Message);
            }
        }