diff options
author | Melanie Thielker | 2009-03-29 05:42:27 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-03-29 05:42:27 +0000 |
commit | c483206fd7ecd67ac4fc8c4e4b71f65dfd3de6c4 (patch) | |
tree | 74474e6dd9b3ed66c23c1de8af0283d3fbc0e896 /OpenSim/Region/CoreModules/Avatar | |
parent | Finish the offline IM module (still needs a server). Add rudimentary (diff) | |
download | opensim-SC_OLD-c483206fd7ecd67ac4fc8c4e4b71f65dfd3de6c4.zip opensim-SC_OLD-c483206fd7ecd67ac4fc8c4e4b71f65dfd3de6c4.tar.gz opensim-SC_OLD-c483206fd7ecd67ac4fc8c4e4b71f65dfd3de6c4.tar.bz2 opensim-SC_OLD-c483206fd7ecd67ac4fc8c4e4b71f65dfd3de6c4.tar.xz |
Change the client API to use GridInstantMessage for the "last mile" of IM
sending. With this change, all methods that handle IM now use GridInstantMessage
rather than individual parameters.
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
5 files changed, 28 insertions, 62 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index d91e10d..edb2c56 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -679,9 +679,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
679 | CreateCallingCard(client, friendID, callingCardFolders[0], friendPresence.Name); | 679 | CreateCallingCard(client, friendID, callingCardFolders[0], friendPresence.Name); |
680 | 680 | ||
681 | // local message means OnGridInstantMessage won't be triggered, so do the work here. | 681 | // local message means OnGridInstantMessage won't be triggered, so do the work here. |
682 | friendPresence.ControllingClient.SendInstantMessage(agentID, agentID.ToString(), friendID, client.Name, | 682 | friendPresence.ControllingClient.SendInstantMessage( |
683 | (byte)InstantMessageDialog.FriendshipAccepted, | 683 | new GridInstantMessage(client.Scene, agentID, |
684 | (uint)Util.UnixTimeSinceEpoch()); | 684 | client.Name, friendID, |
685 | (byte)InstantMessageDialog.FriendshipAccepted, | ||
686 | agentID.ToString(), false, Vector3.Zero)); | ||
685 | ApproveFriendship(agentID, friendID, client.Name); | 687 | ApproveFriendship(agentID, friendID, client.Name); |
686 | } | 688 | } |
687 | else | 689 | else |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index 01717ce..038f5c1 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs | |||
@@ -137,12 +137,14 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
137 | 137 | ||
138 | if ((client != null) && !success) | 138 | if ((client != null) && !success) |
139 | { | 139 | { |
140 | client.SendInstantMessage(new UUID(im.toAgentID), | 140 | client.SendInstantMessage( |
141 | "Unable to send instant message. "+ | 141 | new GridInstantMessage( |
142 | "User is not logged in.", | 142 | null, new UUID(im.fromAgentID), "System", |
143 | new UUID(im.fromAgentID), "System", | 143 | new UUID(im.toAgentID), |
144 | (byte)InstantMessageDialog.BusyAutoResponse, | 144 | (byte)InstantMessageDialog.BusyAutoResponse, |
145 | (uint)Util.UnixTimeSinceEpoch()); | 145 | "Unable to send instant message. "+ |
146 | "User is not logged in.", false, | ||
147 | new Vector3())); | ||
146 | } | 148 | } |
147 | } | 149 | } |
148 | ); | 150 | ); |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index d8d6219..23aaabe 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | |||
@@ -113,16 +113,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
113 | if (!user.IsChildAgent) | 113 | if (!user.IsChildAgent) |
114 | { | 114 | { |
115 | m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client"); | 115 | m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client"); |
116 | user.ControllingClient.SendInstantMessage( | 116 | user.ControllingClient.SendInstantMessage(im); |
117 | new UUID(im.fromAgentID), | 117 | |
118 | im.message, | ||
119 | new UUID(im.toAgentID), | ||
120 | im.fromAgentName, | ||
121 | im.dialog, | ||
122 | im.timestamp, | ||
123 | new UUID(im.imSessionID), | ||
124 | im.fromGroup, | ||
125 | im.binaryBucket); | ||
126 | // Message sent | 118 | // Message sent |
127 | result(true); | 119 | result(true); |
128 | return; | 120 | return; |
@@ -143,16 +135,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
143 | ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; | 135 | ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; |
144 | 136 | ||
145 | m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client"); | 137 | m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client"); |
146 | user.ControllingClient.SendInstantMessage( | 138 | user.ControllingClient.SendInstantMessage(im); |
147 | new UUID(im.fromAgentID), | 139 | |
148 | im.message, | ||
149 | new UUID(im.toAgentID), | ||
150 | im.fromAgentName, | ||
151 | im.dialog, | ||
152 | im.timestamp, | ||
153 | new UUID(im.imSessionID), | ||
154 | im.fromGroup, | ||
155 | im.binaryBucket); | ||
156 | // Message sent | 140 | // Message sent |
157 | result(true); | 141 | result(true); |
158 | return; | 142 | return; |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index 814b2de..9eb8e27 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs | |||
@@ -167,11 +167,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
167 | { | 167 | { |
168 | DateTime saved = Util.ToDateTime((uint)im.timestamp); | 168 | DateTime saved = Util.ToDateTime((uint)im.timestamp); |
169 | 169 | ||
170 | client.SendInstantMessage(new UUID(im.toAgentID), | 170 | im.message = "(saved " + saved.ToString() + ") " + im.message; |
171 | "(saved " + saved.ToString() + ") " + im.message, | 171 | client.SendInstantMessage(im); |
172 | new UUID(im.fromAgentID), im.fromAgentName, | ||
173 | (byte)im.dialog, | ||
174 | (uint)im.timestamp); | ||
175 | } | 172 | } |
176 | } | 173 | } |
177 | 174 | ||
@@ -188,12 +185,13 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
188 | if (client == null) | 185 | if (client == null) |
189 | return; | 186 | return; |
190 | 187 | ||
191 | client.SendInstantMessage(new UUID(im.fromAgentID), | 188 | client.SendInstantMessage(new GridInstantMessage( |
189 | null, new UUID(im.toAgentID), | ||
190 | "System", new UUID(im.fromAgentID), | ||
191 | (byte)InstantMessageDialog.MessageFromAgent, | ||
192 | "User is not logged in. "+ | 192 | "User is not logged in. "+ |
193 | (success ? "Message saved." : "Message not saved"), | 193 | (success ? "Message saved." : "Message not saved"), |
194 | new UUID(im.toAgentID), "System", | 194 | false, new Vector3())); |
195 | (byte)InstantMessageDialog.MessageFromAgent, | ||
196 | (uint)Util.UnixTimeSinceEpoch()); | ||
197 | } | 195 | } |
198 | } | 196 | } |
199 | } | 197 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 2939282..b8e4f08 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -212,11 +212,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
212 | // And notify. Transaction ID is the item ID. We get that | 212 | // And notify. Transaction ID is the item ID. We get that |
213 | // same ID back on the reply so we know what to act on | 213 | // same ID back on the reply so we know what to act on |
214 | // | 214 | // |
215 | user.ControllingClient.SendInstantMessage( | 215 | user.ControllingClient.SendInstantMessage(im); |
216 | new UUID(im.fromAgentID), im.message, | ||
217 | new UUID(im.toAgentID), | ||
218 | im.fromAgentName, im.dialog, im.timestamp, | ||
219 | copyID, false, im.binaryBucket); | ||
220 | 216 | ||
221 | return; | 217 | return; |
222 | } | 218 | } |
@@ -232,11 +228,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
232 | 228 | ||
233 | if (user != null) // Local | 229 | if (user != null) // Local |
234 | { | 230 | { |
235 | user.ControllingClient.SendInstantMessage( | 231 | user.ControllingClient.SendInstantMessage(im); |
236 | new UUID(im.fromAgentID), im.message, | ||
237 | new UUID(im.toAgentID), | ||
238 | im.fromAgentName, im.dialog, im.timestamp, | ||
239 | UUID.Zero, false, im.binaryBucket); | ||
240 | } | 232 | } |
241 | else | 233 | else |
242 | { | 234 | { |
@@ -303,11 +295,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
303 | 295 | ||
304 | if (user != null) // Local | 296 | if (user != null) // Local |
305 | { | 297 | { |
306 | user.ControllingClient.SendInstantMessage( | 298 | user.ControllingClient.SendInstantMessage(im); |
307 | new UUID(im.fromAgentID), im.message, | ||
308 | new UUID(im.toAgentID), | ||
309 | im.fromAgentName, im.dialog, im.timestamp, | ||
310 | UUID.Zero, false, im.binaryBucket); | ||
311 | } | 299 | } |
312 | else | 300 | else |
313 | { | 301 | { |
@@ -460,11 +448,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
460 | 448 | ||
461 | // Deliver message | 449 | // Deliver message |
462 | // | 450 | // |
463 | user.ControllingClient.SendInstantMessage( | 451 | user.ControllingClient.SendInstantMessage(msg); |
464 | new UUID(msg.fromAgentID), msg.message, | ||
465 | new UUID(msg.toAgentID), | ||
466 | msg.fromAgentName, msg.dialog, msg.timestamp, | ||
467 | folderID, false, msg.binaryBucket); | ||
468 | } | 452 | } |
469 | else | 453 | else |
470 | { | 454 | { |
@@ -497,11 +481,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
497 | 481 | ||
498 | // Deliver message | 482 | // Deliver message |
499 | // | 483 | // |
500 | user.ControllingClient.SendInstantMessage( | 484 | user.ControllingClient.SendInstantMessage(msg); |
501 | new UUID(msg.fromAgentID), msg.message, | ||
502 | new UUID(msg.toAgentID), | ||
503 | msg.fromAgentName, msg.dialog, msg.timestamp, | ||
504 | itemID, false, msg.binaryBucket); | ||
505 | } | 485 | } |
506 | } | 486 | } |
507 | } | 487 | } |