[Opensim-dev] [Opensim-commits] r8496 - in trunk/OpenSim/Region: CoreModules/Avatar/InstantMessage Framework/Interfaces
Justin Clark-Casey
jjustincc at googlemail.com
Thu Feb 19 15:14:42 UTC 2009
Melanie wrote:
> As a concept, +1. The config file setup makes it so it will never
> happen by default and I'm good with it being a conscious user action.
>
> The implementation should be discussed, that may be possible to
> include in/link with the region module interface revamp.
+1. Yes, let's properly discuss and design this when it becomes necessary. I was actually waiting for Homer to do the
region module interface changes he was talking about first. Possibly this could be combined though I also didn't want
to oblige Homer to have to think about too many things at once and risk making a doable task into one which became too
daunting to bite off.
>
> Melanie
>
> Justin Clark-Casey wrote:
>> mw at opensimulator.org wrote:
>>> Author: mw
>>> Date: 2009-02-19 04:38:17 -0800 (Thu, 19 Feb 2009)
>>> New Revision: 8496
>>>
>>> Modified:
>>> trunk/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
>>> trunk/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs
>>> Log:
>>> reverted last revision, until we decide how to handle capturing IM's
>> mw, was this in support of the jabber/xmpp bridge that you've coded?
>>
>> If so, I encountered a similar problem while doing the parallel selves message bridge. My 'solution' was to entirely
>> replace the MessageTransfer (and chat) modules, which is just nasty.
>>
>> My thoughts for a long term solution were to
>>
>> a) Make some event calls such as those on EventManager.OnIncomingInstantMessage require a boolean to be returned by each
>> call (which I believe is possible in c#). This boolean would signal that the message has already been completely
>> handled, and that it shouldn't be passed on to other modules.
>>
>> b) Define an 'order' in which modules are loaded in some config file.
>>
>> With these two things, an xmpp bridge module could be loaded before the 'ordinary' im module. If it gets an incoming im
>> which it can handle, then it handles it and returns true (to signal that it shouldn't be passed on to any other module).
>> If it can't handle it then it simply returns false and the message goes through to the next module on the list (in
>> this case, the 'ordinary' module).
>>
>> I like this solution because I think that it allows composibility - you can load lots of different
>> OnIncomingInstantMessage handling modules without any of them having to be aware of any other.
>>
>> What do you (or others) think? Are there better approaches?
>>
>>> Modified: trunk/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
>>> ===================================================================
>>> --- trunk/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs 2009-02-19 11:54:53 UTC (rev 8495)
>>> +++ trunk/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs 2009-02-19 12:38:17 UTC (rev 8496)
>>> @@ -48,10 +48,6 @@
>>> private List<Scene> m_Scenes = new List<Scene>();
>>> private Dictionary<UUID, ulong> m_UserRegionMap = new Dictionary<UUID, ulong>();
>>>
>>> - public event ExternalHandleIM OnExternalIMCapture;
>>> -
>>> - private ExternalHandleIM handlerExternalIMCapture;
>>> -
>>> public void Initialise(Scene scene, IConfigSource config)
>>> {
>>> IConfig cnf = config.Configs["Messaging"];
>>> @@ -99,16 +95,6 @@
>>>
>>> public void SendInstantMessage(GridInstantMessage im, MessageResultNotification result)
>>> {
>>> - handlerExternalIMCapture = OnExternalIMCapture;
>>> - if (handlerExternalIMCapture != null)
>>> - {
>>> - if (handlerExternalIMCapture(im))
>>> - {
>>> - result(true);
>>> - return;
>>> - }
>>> - }
>>> -
>>> UUID toAgentID = new UUID(im.toAgentID);
>>>
>>> m_log.DebugFormat("[INSTANT MESSAGE]: Attempting delivery of IM from {0} to {1}", im.fromAgentName, toAgentID.ToString());
>>>
>>> Modified: trunk/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs
>>> ===================================================================
>>> --- trunk/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs 2009-02-19 11:54:53 UTC (rev 8495)
>>> +++ trunk/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs 2009-02-19 12:38:17 UTC (rev 8496)
>>> @@ -30,12 +30,9 @@
>>> namespace OpenSim.Region.Framework.Interfaces
>>> {
>>> public delegate void MessageResultNotification(bool success);
>>> - public delegate bool ExternalHandleIM(GridInstantMessage im);
>>> -
>>> +
>>> public interface IMessageTransferModule
>>> {
>>> - event ExternalHandleIM OnExternalIMCapture;
>>> -
>>> void SendInstantMessage(GridInstantMessage im, MessageResultNotification result);
>>> }
>>> }
>>>
>>> _______________________________________________
>>> Opensim-commits mailing list
>>> Opensim-commits at lists.berlios.de
>>> https://lists.berlios.de/mailman/listinfo/opensim-commits
>>>
>>
> _______________________________________________
> Opensim-dev mailing list
> Opensim-dev at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-dev
>
--
justincc
Justin Clark-Casey
http://justincc.wordpress.com
More information about the Opensim-dev
mailing list