This commit is contained in:
@@ -200,7 +200,7 @@ namespace rockfishCore.Util
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region handle read and move message
|
#region handle read and move message
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -228,10 +228,14 @@ namespace rockfishCore.Util
|
|||||||
client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES);
|
client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES);
|
||||||
}
|
}
|
||||||
|
|
||||||
//AyaNovaReceivedNOTSUB
|
//AyaNovaReceivedNOTSUB
|
||||||
//AyaNovaReceivedSubscribed
|
//AyaNovaReceivedSubscribed
|
||||||
|
|
||||||
var newFolder = client.GetFolder(toSubscribed?"AyaNovaReceivedSubscribed":"AyaNovaReceivedNOTSUB");
|
//Flag as read
|
||||||
|
//flag the message as having been replied to
|
||||||
|
FlagMessageSeen(moveMessageId, replyFromAccount);
|
||||||
|
|
||||||
|
var newFolder = client.GetFolder(toSubscribed ? "AyaNovaReceivedSubscribed" : "AyaNovaReceivedNOTSUB");
|
||||||
|
|
||||||
if (newFolder != null)
|
if (newFolder != null)
|
||||||
{
|
{
|
||||||
@@ -443,6 +447,39 @@ namespace rockfishCore.Util
|
|||||||
}//get message
|
}//get message
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Flag message as seen
|
||||||
|
public static bool FlagMessageSeen(uint uid, rfMailAccount inAccount = rfMailAccount.support)
|
||||||
|
{
|
||||||
|
using (var client = new ImapClient())
|
||||||
|
{
|
||||||
|
// Accept all SSL certificates
|
||||||
|
client.ServerCertificateValidationCallback = (s, c, h, e) => true;
|
||||||
|
client.Connect(MAIL_IMAP_ADDRESS, MAIL_IMAP_PORT);
|
||||||
|
// Note: since we don't have an OAuth2 token, disable
|
||||||
|
// the XOAUTH2 authentication mechanism.
|
||||||
|
client.AuthenticationMechanisms.Remove("XOAUTH2");
|
||||||
|
|
||||||
|
if (inAccount == rfMailAccount.support)
|
||||||
|
{
|
||||||
|
client.Authenticate(MAIL_ACCOUNT_SUPPORT, MAIL_ACCOUNT_PASSWORD_SUPPORT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES);
|
||||||
|
}
|
||||||
|
|
||||||
|
var inbox = client.Inbox;
|
||||||
|
inbox.Open(FolderAccess.ReadWrite);
|
||||||
|
inbox.AddFlags(new UniqueId(uid), MessageFlags.Seen, true);
|
||||||
|
// inbox.AddFlags(new UniqueId(uid), MessageFlags.Answered, true);
|
||||||
|
client.Disconnect(true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}//get message
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
//Put a message in the drafts folder of support
|
//Put a message in the drafts folder of support
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ app.mailEdit = (function() {
|
|||||||
var stateMap = {},
|
var stateMap = {},
|
||||||
onSend,
|
onSend,
|
||||||
onSpam,
|
onSpam,
|
||||||
|
onMoveToSub,
|
||||||
|
onMoveToNotSub,
|
||||||
configModule,
|
configModule,
|
||||||
initModule;
|
initModule;
|
||||||
//----------------- END MODULE SCOPE VARIABLES ---------------
|
//----------------- END MODULE SCOPE VARIABLES ---------------
|
||||||
@@ -241,7 +243,8 @@ app.mailEdit = (function() {
|
|||||||
|
|
||||||
//Context menu
|
//Context menu
|
||||||
app.nav.contextAddButton("btn-generate", "IsSpam", "axe", onSpam);
|
app.nav.contextAddButton("btn-generate", "IsSpam", "axe", onSpam);
|
||||||
app.nav.contextAddButton("btn-generate", "IsSpam", "axe", onSpam);
|
app.nav.contextAddButton("btn-movetosub", "MoveSub", "account-star", onMoveToSub);
|
||||||
|
app.nav.contextAddButton("btn-movetonotsub", "MoveNOTSub", "account-off-outline", onMoveToNotSub);
|
||||||
|
|
||||||
//Move to subscribed or not subscribed
|
//Move to subscribed or not subscribed
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user