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