mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 20:55:43 +08:00
make llEmail async
This commit is contained in:
@@ -3993,28 +3993,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Restrict email destination to the avatars registered email address?
|
// this is a fire and forget no event is sent to script
|
||||||
//The restriction only applies if the destination address is not local.
|
Action<string> act = eventID =>
|
||||||
if (m_restrictEmail == true && address.Contains(m_internalObjectHost) == false)
|
|
||||||
{
|
{
|
||||||
UserAccount account = m_userAccountService.GetUserAccount(RegionScopeID, m_host.OwnerID);
|
//Restrict email destination to the avatars registered email address?
|
||||||
|
//The restriction only applies if the destination address is not local.
|
||||||
if (account == null)
|
if (m_restrictEmail == true && address.Contains(m_internalObjectHost) == false)
|
||||||
{
|
{
|
||||||
Error("llEmail", "Can't find user account for '" + m_host.OwnerID.ToString() + "'");
|
UserAccount account = m_userAccountService.GetUserAccount(RegionScopeID, m_host.OwnerID);
|
||||||
return;
|
if (account == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(account.Email))
|
||||||
|
return;
|
||||||
|
address = account.Email;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(account.Email))
|
m_emailModule.SendEmail(m_host.UUID, address, subject, message);
|
||||||
{
|
// no dataserver event
|
||||||
Error("llEmail", "User account has not registered an email address.");
|
};
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
address = account.Email;
|
UUID dummytis = m_AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId,
|
||||||
}
|
m_item.ItemID, UUID.Random().ToString(), act);
|
||||||
|
|
||||||
m_emailModule.SendEmail(m_host.UUID, address, subject, message);
|
|
||||||
ScriptSleep(m_sleepMsOnEmail);
|
ScriptSleep(m_sleepMsOnEmail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user