diff options
author | Charles Krinke | 2008-07-03 20:58:29 +0000 |
---|---|---|
committer | Charles Krinke | 2008-07-03 20:58:29 +0000 |
commit | b1ab680a66a3a6bdcf4976a342cc28412f6e2b2d (patch) | |
tree | 1c6d0c65707185dd0bf63b59433de2fc411216cf /OpenSim/Region/Environment/Modules/Scripting | |
parent | add 3 migrations, 1 each for prims, primshapes, and primitems (diff) | |
download | opensim-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.cs | 90 |
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 @@ | |||
1 | using System; | ||
2 | using System.Reflection; | ||
3 | using System.Collections.Generic; | ||
4 | using libsecondlife; | ||
5 | using OpenSim.Framework; | ||
6 | using OpenSim.Region.Environment.Interfaces; | ||
7 | using OpenSim.Region.Environment.Scenes; | ||
8 | using log4net; | ||
9 | using Nini.Config; | ||
10 | |||
11 | namespace 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 | } | ||