From 2f435783866656f8e75ba96febe688378ff320b0 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 2 Jan 2008 03:05:18 +0000 Subject: * Re-wrote IM that sends the friend request so that it displays the name of the person who sent the request, or (hippos) if it can't find it. --- OpenSim/Framework/IClientAPI.cs | 2 +- OpenSim/Region/ClientStack/ClientView.cs | 2 +- OpenSim/Region/Environment/Modules/FriendsModule.cs | 13 ++++++++++--- OpenSim/Region/Environment/Modules/InstantMessageModule.cs | 4 ++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index c5e4809..f0ec63e 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -223,7 +223,7 @@ namespace OpenSim.Framework public delegate void AvatarNowWearing(Object sender, AvatarWearingArgs e); - public delegate void ImprovedInstantMessage( + public delegate void ImprovedInstantMessage(IClientAPI remoteclient, LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, uint ParentEstateID, LLVector3 Position, LLUUID RegionID, byte[] binaryBucket); // This shouldn't be cut down... diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index aa8ab1d..414916c 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -2550,7 +2550,7 @@ namespace OpenSim.Region.ClientStack string IMmessage = Helpers.FieldToUTF8String(msgpack.MessageBlock.Message); if (OnInstantMessage != null) { - OnInstantMessage(msgpack.AgentData.AgentID, msgpack.AgentData.SessionID, + OnInstantMessage(this,msgpack.AgentData.AgentID, msgpack.AgentData.SessionID, msgpack.MessageBlock.ToAgentID, msgpack.MessageBlock.ID, msgpack.MessageBlock.Timestamp, IMfromName, IMmessage, msgpack.MessageBlock.Dialog, msgpack.MessageBlock.FromGroup, diff --git a/OpenSim/Region/Environment/Modules/FriendsModule.cs b/OpenSim/Region/Environment/Modules/FriendsModule.cs index d6be63b..fec28a8 100644 --- a/OpenSim/Region/Environment/Modules/FriendsModule.cs +++ b/OpenSim/Region/Environment/Modules/FriendsModule.cs @@ -72,7 +72,7 @@ namespace OpenSim.Region.Environment.Modules } - private void OnInstantMessage(LLUUID fromAgentID, + private void OnInstantMessage(IClientAPI client,LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, @@ -97,7 +97,14 @@ namespace OpenSim.Region.Environment.Modules msg.imSessionID = friendTransactionID.UUID; // This is the item we're mucking with here m_log.Verbose("FRIEND","Filling Session: " + msg.imSessionID.ToString()); msg.timestamp = timestamp; - msg.fromAgentName = fromAgentName; + if (client != null) + { + msg.fromAgentName = client.FirstName + " " + client.LastName;// fromAgentName; + } + else + { + msg.fromAgentName = "(hippos)";// Added for posterity. This means that we can't figure out who sent it + } msg.message = message; msg.dialog = dialog; msg.fromGroup = fromGroup; @@ -194,7 +201,7 @@ namespace OpenSim.Region.Environment.Modules private void OnGridInstantMessage(GridInstantMessage msg) { // Trigger the above event handler - OnInstantMessage(new LLUUID(msg.fromAgentID), new LLUUID(msg.fromAgentSession), + OnInstantMessage(null,new LLUUID(msg.fromAgentID), new LLUUID(msg.fromAgentSession), new LLUUID(msg.toAgentID), new LLUUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, msg.message, msg.dialog, msg.fromGroup, msg.offline, msg.ParentEstateID, new LLVector3(msg.Position.x, msg.Position.y, msg.Position.z), new LLUUID(msg.RegionID), diff --git a/OpenSim/Region/Environment/Modules/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/InstantMessageModule.cs index 0967b70..f5eb052 100644 --- a/OpenSim/Region/Environment/Modules/InstantMessageModule.cs +++ b/OpenSim/Region/Environment/Modules/InstantMessageModule.cs @@ -61,7 +61,7 @@ namespace OpenSim.Region.Environment.Modules client.OnInstantMessage += OnInstantMessage; } - private void OnInstantMessage(LLUUID fromAgentID, + private void OnInstantMessage(IClientAPI client,LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, @@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules private void OnGridInstantMessage(GridInstantMessage msg) { // Trigger the above event handler - OnInstantMessage(new LLUUID(msg.fromAgentID), new LLUUID(msg.fromAgentSession), + OnInstantMessage(null,new LLUUID(msg.fromAgentID), new LLUUID(msg.fromAgentSession), new LLUUID(msg.toAgentID), new LLUUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, msg.message, msg.dialog, msg.fromGroup, msg.offline, msg.ParentEstateID, new LLVector3(msg.Position.x,msg.Position.y,msg.Position.z), new LLUUID(msg.RegionID), -- cgit v1.1