aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorOren Hurvitz2013-10-29 16:03:58 +0200
committerJustin Clark-Casey (justincc)2014-01-16 00:16:33 +0000
commit46c2791fe2f9ea92535d3933602e24dcba8f96f9 (patch)
treef57849d8fe1568a7ce49aceda182f2d81e885f70 /OpenSim
parentFixed offline IM (diff)
downloadopensim-SC-46c2791fe2f9ea92535d3933602e24dcba8f96f9.zip
opensim-SC-46c2791fe2f9ea92535d3933602e24dcba8f96f9.tar.gz
opensim-SC-46c2791fe2f9ea92535d3933602e24dcba8f96f9.tar.bz2
opensim-SC-46c2791fe2f9ea92535d3933602e24dcba8f96f9.tar.xz
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.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs3
-rw-r--r--OpenSim/Addons/OfflineIM/Service/OfflineIMService.cs3
-rw-r--r--OpenSim/Data/IOfflineIMData.cs3
-rw-r--r--OpenSim/Data/MySQL/Resources/IM_Store.migrations12
4 files changed, 16 insertions, 5 deletions
diff --git a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs
index 32c24db..6158abc 100644
--- a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs
+++ b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -96,7 +96,6 @@ namespace OpenSim.OfflineIM
96 string method = request["METHOD"].ToString(); 96 string method = request["METHOD"].ToString();
97 request.Remove("METHOD"); 97 request.Remove("METHOD");
98 98
99 m_log.DebugFormat("[OfflineIM.V2.Handler]: {0}", method);
100 switch (method) 99 switch (method)
101 { 100 {
102 case "GET": 101 case "GET":
diff --git a/OpenSim/Addons/OfflineIM/Service/OfflineIMService.cs b/OpenSim/Addons/OfflineIM/Service/OfflineIMService.cs
index d36f9a4..df0c53f 100644
--- a/OpenSim/Addons/OfflineIM/Service/OfflineIMService.cs
+++ b/OpenSim/Addons/OfflineIM/Service/OfflineIMService.cs
@@ -91,7 +91,7 @@ namespace OpenSim.OfflineIM
91 { 91 {
92 reason = string.Empty; 92 reason = string.Empty;
93 93
94 // TODO Check limits 94 // Check limits
95 UUID principalID = new UUID(im.toAgentID); 95 UUID principalID = new UUID(im.toAgentID);
96 long count = m_Database.GetCount("PrincipalID", principalID.ToString()); 96 long count = m_Database.GetCount("PrincipalID", principalID.ToString());
97 if (count >= MAX_IM) 97 if (count >= MAX_IM)
@@ -117,6 +117,7 @@ namespace OpenSim.OfflineIM
117 117
118 OfflineIMData data = new OfflineIMData(); 118 OfflineIMData data = new OfflineIMData();
119 data.PrincipalID = principalID; 119 data.PrincipalID = principalID;
120 data.FromID = new UUID(im.fromAgentID);
120 data.Data = new Dictionary<string, string>(); 121 data.Data = new Dictionary<string, string>();
121 data.Data["Message"] = imXml; 122 data.Data["Message"] = imXml;
122 123
diff --git a/OpenSim/Data/IOfflineIMData.cs b/OpenSim/Data/IOfflineIMData.cs
index e780304..58501a3 100644
--- a/OpenSim/Data/IOfflineIMData.cs
+++ b/OpenSim/Data/IOfflineIMData.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -34,6 +34,7 @@ namespace OpenSim.Data
34 public class OfflineIMData 34 public class OfflineIMData
35 { 35 {
36 public UUID PrincipalID; 36 public UUID PrincipalID;
37 public UUID FromID;
37 public Dictionary<string, string> Data; 38 public Dictionary<string, string> Data;
38 } 39 }
39 40
diff --git a/OpenSim/Data/MySQL/Resources/IM_Store.migrations b/OpenSim/Data/MySQL/Resources/IM_Store.migrations
index 7cfcd43..f73475e 100644
--- a/OpenSim/Data/MySQL/Resources/IM_Store.migrations
+++ b/OpenSim/Data/MySQL/Resources/IM_Store.migrations
@@ -21,4 +21,14 @@ INSERT INTO `im_offline` SELECT * from `diva_im_offline`;
21DROP TABLE `diva_im_offline`; 21DROP TABLE `diva_im_offline`;
22DELETE FROM `migrations` WHERE name='diva_im_Store'; 22DELETE FROM `migrations` WHERE name='diva_im_Store';
23 23
24COMMIT; \ No newline at end of file 24COMMIT;
25
26:VERSION 3 # --------------------------
27
28BEGIN;
29
30ALTER TABLE `im_offline`
31 ADD `FromID` char(36) NOT NULL default '' AFTER `PrincipalID`,
32 ADD KEY `FromID` (`FromID`);
33
34COMMIT;