aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Scripting
diff options
context:
space:
mode:
authorCharles Krinke2008-07-03 20:58:29 +0000
committerCharles Krinke2008-07-03 20:58:29 +0000
commitb1ab680a66a3a6bdcf4976a342cc28412f6e2b2d (patch)
tree1c6d0c65707185dd0bf63b59433de2fc411216cf /OpenSim/Region/Environment/Modules/Scripting
parentadd 3 migrations, 1 each for prims, primshapes, and primitems (diff)
downloadopensim-SC_OLD-b1ab680a66a3a6bdcf4976a342cc28412f6e2b2d.zip
opensim-SC_OLD-b1ab680a66a3a6bdcf4976a342cc28412f6e2b2d.tar.gz
opensim-SC_OLD-b1ab680a66a3a6bdcf4976a342cc28412f6e2b2d.tar.bz2
opensim-SC_OLD-b1ab680a66a3a6bdcf4976a342cc28412f6e2b2d.tar.xz
Mantis#1658. Thank you, Melanie for a patch that:
Adds IEmailModule and a module skelaton
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Scripting')
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs90
1 files changed, 90 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs
new file mode 100644
index 0000000..5d33b04
--- /dev/null
+++ b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs
@@ -0,0 +1,90 @@
1using System;
2using System.Reflection;
3using System.Collections.Generic;
4using libsecondlife;
5using OpenSim.Framework;
6using OpenSim.Region.Environment.Interfaces;
7using OpenSim.Region.Environment.Scenes;
8using log4net;
9using Nini.Config;
10
11namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules
12{
13 public class EmailModule : IEmailModule
14 {
15 //
16 // Log
17 //
18 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
19
20 //
21 // Module vars
22 //
23 private IConfigSource m_Config;
24
25 // Scenes by Region Handle
26 private Dictionary<ulong, Scene> m_Scenes =
27 new Dictionary<ulong, Scene>();
28
29 private bool m_Enabled = false;
30
31 public void Initialise(Scene scene, IConfigSource config)
32 {
33 m_Config = config;
34
35 IConfig startupConfig = m_Config.Configs["Startup"];
36
37 m_Enabled = (startupConfig.GetString("emailmodule",
38 "DefaultEmailModule") == "DefaultEmailModule");
39
40 // It's a go!
41 if (m_Enabled)
42 {
43 lock (m_Scenes)
44 {
45 // Claim the interface slot
46 scene.RegisterModuleInterface<IEmailModule>(this);
47
48 // Add to scene list
49 if (m_Scenes.ContainsKey(scene.RegionInfo.RegionHandle))
50 {
51 m_Scenes[scene.RegionInfo.RegionHandle] = scene;
52 }
53 else
54 {
55 m_Scenes.Add(scene.RegionInfo.RegionHandle, scene);
56 }
57 }
58
59 m_log.Info("[EMAIL] Activated DefaultEmailModule");
60 }
61 }
62
63 public void PostInitialise()
64 {
65 }
66
67 public void Close()
68 {
69 }
70
71 public string Name
72 {
73 get { return "DefaultEmailModule"; }
74 }
75
76 public bool IsSharedModule
77 {
78 get { return true; }
79 }
80
81 public void SendEmail(LLUUID objectID, string address, string subject, string body)
82 {
83 }
84
85 public Email GetNextEmail(LLUUID objectID, string sender, string subject)
86 {
87 return null;
88 }
89 }
90}