In the offline message table, store the sender.

This data is useful for preventing abuse (e.g., someone who sends too many messages), or for deleting message if their sender has been deleted.
master-beforevarregion
Oren Hurvitz 2013-10-29 16:03:58 +02:00 committed by Justin Clark-Casey (justincc)
parent 21bc799a17
commit 46c2791fe2
4 changed files with 16 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* /*
* Copyright (c) Contributors, http://opensimulator.org/ * Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders. * See CONTRIBUTORS.TXT for a full list of copyright holders.
* *
@ -96,7 +96,6 @@ namespace OpenSim.OfflineIM
string method = request["METHOD"].ToString(); string method = request["METHOD"].ToString();
request.Remove("METHOD"); request.Remove("METHOD");
m_log.DebugFormat("[OfflineIM.V2.Handler]: {0}", method);
switch (method) switch (method)
{ {
case "GET": case "GET":

View File

@ -91,7 +91,7 @@ namespace OpenSim.OfflineIM
{ {
reason = string.Empty; reason = string.Empty;
// TODO Check limits // Check limits
UUID principalID = new UUID(im.toAgentID); UUID principalID = new UUID(im.toAgentID);
long count = m_Database.GetCount("PrincipalID", principalID.ToString()); long count = m_Database.GetCount("PrincipalID", principalID.ToString());
if (count >= MAX_IM) if (count >= MAX_IM)
@ -117,6 +117,7 @@ namespace OpenSim.OfflineIM
OfflineIMData data = new OfflineIMData(); OfflineIMData data = new OfflineIMData();
data.PrincipalID = principalID; data.PrincipalID = principalID;
data.FromID = new UUID(im.fromAgentID);
data.Data = new Dictionary<string, string>(); data.Data = new Dictionary<string, string>();
data.Data["Message"] = imXml; data.Data["Message"] = imXml;

View File

@ -1,4 +1,4 @@
/* /*
* Copyright (c) Contributors, http://opensimulator.org/ * Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders. * See CONTRIBUTORS.TXT for a full list of copyright holders.
* *
@ -34,6 +34,7 @@ namespace OpenSim.Data
public class OfflineIMData public class OfflineIMData
{ {
public UUID PrincipalID; public UUID PrincipalID;
public UUID FromID;
public Dictionary<string, string> Data; public Dictionary<string, string> Data;
} }

View File

@ -21,4 +21,14 @@ INSERT INTO `im_offline` SELECT * from `diva_im_offline`;
DROP TABLE `diva_im_offline`; DROP TABLE `diva_im_offline`;
DELETE FROM `migrations` WHERE name='diva_im_Store'; DELETE FROM `migrations` WHERE name='diva_im_Store';
COMMIT; COMMIT;
:VERSION 3 # --------------------------
BEGIN;
ALTER TABLE `im_offline`
ADD `FromID` char(36) NOT NULL default '' AFTER `PrincipalID`,
ADD KEY `FromID` (`FromID`);
COMMIT;