From 92a766e8cb38ed0cf2f778d95e192275cd4e3100 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 27 Nov 2012 21:10:58 -0800 Subject: [PATCH] Bug fix in Offline IM for inventory transfers. The items were being placed twice in the receiver's inventory. --- .../InstantMessage/OfflineMessageModule.cs | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index 4aaf1feab1..41364d7683 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs @@ -186,17 +186,21 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage foreach (GridInstantMessage im in msglist) { - // client.SendInstantMessage(im); - - // Send through scene event manager so all modules get a chance - // to look at this message before it gets delivered. - // - // Needed for proper state management for stored group - // invitations - // - Scene s = FindScene(client.AgentId); - if (s != null) - s.EventManager.TriggerIncomingInstantMessage(im); + if (im.dialog == (byte)InstantMessageDialog.InventoryOffered) + // send it directly or else the item will be given twice + client.SendInstantMessage(im); + else + { + // Send through scene event manager so all modules get a chance + // to look at this message before it gets delivered. + // + // Needed for proper state management for stored group + // invitations + // + Scene s = FindScene(client.AgentId); + if (s != null) + s.EventManager.TriggerIncomingInstantMessage(im); + } } } }