Strip estate message sending out from the estate management module and

the dialog module. Convert it to an event on the estate module interface.
The old implementation did the same as message to region, a button that
is right next to it on the UI. This implementation prevented people from
adding a more sane one in a module.
This commit is contained in:
Melanie Thielker
2010-05-04 23:45:59 +02:00
parent 07e0732a10
commit 49efec2ef1
4 changed files with 12 additions and 25 deletions

View File

@@ -132,14 +132,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url);
}
public void SendNotificationToUsersInEstate(
UUID fromAvatarID, string fromAvatarName, string message)
{
// TODO: This does not yet do what it says on the tin - it only sends the message to users in the same
// region as the sending avatar.
SendNotificationToUsersInRegion(fromAvatarID, fromAvatarName, message);
}
public void SendTextBoxToUser(UUID avatarid, string message, int chatChannel, string name, UUID objectid, UUID ownerid)
{
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerid);

View File

@@ -50,6 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
public event ChangeDelegate OnRegionInfoChange;
public event ChangeDelegate OnEstateInfoChange;
public event MessageDelegate OnEstateMessage;
#region Packet Data Responders
@@ -440,10 +441,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
private void SendEstateBlueBoxMessage(
IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message)
{
IDialogModule dm = m_scene.RequestModuleInterface<IDialogModule>();
if (dm != null)
dm.SendNotificationToUsersInEstate(senderID, senderName, message);
TriggerEstateMessage(senderID, senderName, message);
}
private void handleEstateDebugRegionRequest(IClientAPI remote_client, UUID invoice, UUID senderID, bool scripted, bool collisionEvents, bool physics)
@@ -1177,5 +1175,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
if (change != null)
change(m_scene.RegionInfo.RegionID);
}
protected void TriggerEstateMessage(UUID fromID, string fromName, string message)
{
MessageDelegate onmessage = OnEstateMessage;
if (onmessage != null)
onmessage(m_scene.RegionInfo.RegionID, fromID, fromName, message);
}
}
}