diff options
author | Melanie Thielker | 2010-05-04 23:45:59 +0200 |
---|---|---|
committer | Melanie | 2010-05-04 21:26:10 +0100 |
commit | 3761f7997134f3515421e9cf19ebb775f296bef2 (patch) | |
tree | 7f838c7164b2fcc8ff2658a1c8933868cec59d60 /OpenSim/Region/CoreModules | |
parent | make the events more useful by providing the source region (diff) | |
download | opensim-SC-3761f7997134f3515421e9cf19ebb775f296bef2.zip opensim-SC-3761f7997134f3515421e9cf19ebb775f296bef2.tar.gz opensim-SC-3761f7997134f3515421e9cf19ebb775f296bef2.tar.bz2 opensim-SC-3761f7997134f3515421e9cf19ebb775f296bef2.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 14 |
2 files changed, 10 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index c31266c..da38ede 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs | |||
@@ -132,14 +132,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
132 | sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url); | 132 | sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url); |
133 | } | 133 | } |
134 | 134 | ||
135 | public void SendNotificationToUsersInEstate( | ||
136 | UUID fromAvatarID, string fromAvatarName, string message) | ||
137 | { | ||
138 | // TODO: This does not yet do what it says on the tin - it only sends the message to users in the same | ||
139 | // region as the sending avatar. | ||
140 | SendNotificationToUsersInRegion(fromAvatarID, fromAvatarName, message); | ||
141 | } | ||
142 | |||
143 | public void SendTextBoxToUser(UUID avatarid, string message, int chatChannel, string name, UUID objectid, UUID ownerid) | 135 | public void SendTextBoxToUser(UUID avatarid, string message, int chatChannel, string name, UUID objectid, UUID ownerid) |
144 | { | 136 | { |
145 | UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerid); | 137 | UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerid); |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index dcc66ca..abd0fcb 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -50,6 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
50 | 50 | ||
51 | public event ChangeDelegate OnRegionInfoChange; | 51 | public event ChangeDelegate OnRegionInfoChange; |
52 | public event ChangeDelegate OnEstateInfoChange; | 52 | public event ChangeDelegate OnEstateInfoChange; |
53 | public event MessageDelegate OnEstateMessage; | ||
53 | 54 | ||
54 | #region Packet Data Responders | 55 | #region Packet Data Responders |
55 | 56 | ||
@@ -440,10 +441,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
440 | private void SendEstateBlueBoxMessage( | 441 | private void SendEstateBlueBoxMessage( |
441 | IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message) | 442 | IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message) |
442 | { | 443 | { |
443 | IDialogModule dm = m_scene.RequestModuleInterface<IDialogModule>(); | 444 | TriggerEstateMessage(senderID, senderName, message); |
444 | |||
445 | if (dm != null) | ||
446 | dm.SendNotificationToUsersInEstate(senderID, senderName, message); | ||
447 | } | 445 | } |
448 | 446 | ||
449 | private void handleEstateDebugRegionRequest(IClientAPI remote_client, UUID invoice, UUID senderID, bool scripted, bool collisionEvents, bool physics) | 447 | 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 | |||
1177 | if (change != null) | 1175 | if (change != null) |
1178 | change(m_scene.RegionInfo.RegionID); | 1176 | change(m_scene.RegionInfo.RegionID); |
1179 | } | 1177 | } |
1178 | |||
1179 | protected void TriggerEstateMessage(UUID fromID, string fromName, string message) | ||
1180 | { | ||
1181 | MessageDelegate onmessage = OnEstateMessage; | ||
1182 | |||
1183 | if (onmessage != null) | ||
1184 | onmessage(m_scene.RegionInfo.RegionID, fromID, fromName, message); | ||
1185 | } | ||
1180 | } | 1186 | } |
1181 | } | 1187 | } |