aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs')
-rw-r--r--OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs22
1 files changed, 19 insertions, 3 deletions
diff --git a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs
index 2b3a01d..13b0e7e 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 *
@@ -75,7 +75,7 @@ namespace OpenSim.OfflineIM
75 m_OfflineIMService = service; 75 m_OfflineIMService = service;
76 } 76 }
77 77
78 public override byte[] Handle(string path, Stream requestData, 78 protected override byte[] ProcessRequest(string path, Stream requestData,
79 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 79 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
80 { 80 {
81 StreamReader sr = new StreamReader(requestData); 81 StreamReader sr = new StreamReader(requestData);
@@ -96,13 +96,14 @@ 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":
103 return HandleGet(request); 102 return HandleGet(request);
104 case "STORE": 103 case "STORE":
105 return HandleStore(request); 104 return HandleStore(request);
105 case "DELETE":
106 return HandleDelete(request);
106 } 107 }
107 m_log.DebugFormat("[OFFLINE IM HANDLER]: unknown method request: {0}", method); 108 m_log.DebugFormat("[OFFLINE IM HANDLER]: unknown method request: {0}", method);
108 } 109 }
@@ -159,6 +160,21 @@ namespace OpenSim.OfflineIM
159 return Util.UTF8NoBomEncoding.GetBytes(xmlString); 160 return Util.UTF8NoBomEncoding.GetBytes(xmlString);
160 } 161 }
161 162
163 byte[] HandleDelete(Dictionary<string, object> request)
164 {
165 if (!request.ContainsKey("UserID"))
166 {
167 return FailureResult();
168 }
169 else
170 {
171 UUID userID = new UUID(request["UserID"].ToString());
172 m_OfflineIMService.DeleteMessages(userID);
173
174 return SuccessResult();
175 }
176 }
177
162 #region Helpers 178 #region Helpers
163 179
164 private void NullResult(Dictionary<string, object> result, string reason) 180 private void NullResult(Dictionary<string, object> result, string reason)