return Email
parent
060761b987
commit
0da86a4ad4
|
@ -35,7 +35,7 @@ namespace OpenSim.Modules.EMail
|
|||
|
||||
private Timer m_timer = null;
|
||||
|
||||
private List<MimeMessage> m_messages = new List<MimeMessage>();
|
||||
private List<InternalMail> m_messages = new List<InternalMail>();
|
||||
|
||||
private String SMTP_SERVER_HOSTNAME = null;
|
||||
private String SMTP_SERVER_LOGIN = null;
|
||||
|
@ -257,38 +257,20 @@ namespace OpenSim.Modules.EMail
|
|||
public Email GetNextEmail(UUID objectID, string sender, string subject)
|
||||
{
|
||||
SceneObjectPart sceneObject = m_scene.GetSceneObjectPart(objectID);
|
||||
|
||||
m_log.Info("[" + Name + "] GetNextEmail: " + sceneObject.Name + " (" + sceneObject.UUID + ")");
|
||||
|
||||
List<MimeMessage> messages = m_messages.FindAll(X => X.Subject.Contains(subject) && X.Sender.GetAddress(true).Contains(sender));
|
||||
List<InternalMail> messages = m_messages.FindAll(X => X.ID == objectID);
|
||||
if (messages.Count == 0)
|
||||
return null;
|
||||
|
||||
MimeMessage lastMessage = null;
|
||||
Email lslMessage = null;
|
||||
Email lslMessage = new Email();
|
||||
lslMessage.time = messages[0].Mail.Date.ToUnixTimeSeconds().ToString();
|
||||
lslMessage.message = messages[0].Mail.Body.ToString();
|
||||
lslMessage.sender = messages[0].Mail.Sender.GetAddress(true);
|
||||
lslMessage.subject = messages[0].Mail.Subject;
|
||||
lslMessage.numLeft = messages.Count - 1;
|
||||
|
||||
foreach (MimeMessage message in messages)
|
||||
{
|
||||
if (lslMessage != null)
|
||||
continue;
|
||||
|
||||
lastMessage = message;
|
||||
|
||||
foreach (MailboxAddress adress in message.To.Mailboxes)
|
||||
{
|
||||
if (lslMessage != null)
|
||||
continue;
|
||||
|
||||
lslMessage = new Email();
|
||||
lslMessage.time = lastMessage.Date.ToUnixTimeSeconds().ToString();
|
||||
lslMessage.message = lastMessage.Body.ToString();
|
||||
lslMessage.sender = lastMessage.Sender.GetAddress(true);
|
||||
lslMessage.subject = lastMessage.Subject;
|
||||
|
||||
lslMessage.numLeft = messages.Count - 1;
|
||||
}
|
||||
}
|
||||
|
||||
if(lastMessage != null)
|
||||
m_messages.Remove(lastMessage);
|
||||
m_messages.Remove(messages[0]);
|
||||
|
||||
return lslMessage;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue