make llEmail async

This commit is contained in:
UbitUmarov
2020-08-15 17:54:31 +01:00
parent d9bccbb7c0
commit 2c8e5c844a

View File

@@ -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);
} }