apply filter

master
Christopher 2020-07-01 21:19:08 +02:00
parent d970dcf602
commit 6cc1949921
1 changed files with 11 additions and 24 deletions

View File

@ -291,47 +291,34 @@ namespace OpenSim.Modules.EMail
if (messages.Count == 0)
return null;
if(messages[0] != null)
foreach (InternalMail mail in messages)
{
if(messages[0].Mail != null)
if (mail.Mail != null)
{
Email lslMessage = new Email();
lslMessage.time = DateTime.Now.ToShortTimeString();
if (messages[0].Mail.TextBody != null)
lslMessage.message = messages[0].Mail.TextBody.ToString();
if (mail.Mail.TextBody != null)
lslMessage.message = mail.Mail.TextBody.ToString();
if (messages[0].Mail.From[0] != null)
lslMessage.sender = messages[0].Mail.From[0].ToString();
if (mail.Mail.From[0] != null)
lslMessage.sender = mail.Mail.From[0].ToString();
if (messages[0].Mail.Subject != null)
lslMessage.subject = messages[0].Mail.Subject;
if (mail.Mail.Subject != null)
lslMessage.subject = mail.Mail.Subject;
lslMessage.numLeft = messages.Count - 1;
if((lslMessage.sender == sender || sender == "") && (lslMessage.subject == subject || subject == ""))
if ((lslMessage.sender == sender || sender == "") && (lslMessage.subject == subject || subject == ""))
{
m_messages.Remove(messages[0]);
m_messages.Remove(mail);
return lslMessage;
}
}
else
{
if (m_debug)
m_log.Error("[" + Name + "] Cant find mail data!");
return null;
}
}
else
{
if (m_debug)
m_log.Error("[" + Name + "] Cant find caller objekt!");
return null;
}
return null;
}
else
{