ソースを参照

Add Channel Who skeleton.

pull/132/head
Greg Holmes 9年前
コミット
47092c0ee4

+ 22
- 0
channelwho/plugin.config ファイルの表示

@@ -0,0 +1,22 @@
1
+# This is a DMDirc configuration file.
2
+
3
+# This section indicates which sections below take key/value
4
+# pairs, rather than a simple list. It should be placed above
5
+# any sections that take key/values.
6
+keysections:
7
+  metadata
8
+  updates
9
+  version
10
+
11
+metadata:
12
+  author=Greg <greg@dmdirc.com>
13
+  mainclass=com.dmdirc.addons.channelwho.ChannelWhoPlugin
14
+  description=Sends WHOs to channels and optionally notifies of away states
15
+  name=channelwho
16
+  nicename=Channel Who
17
+
18
+updates:
19
+  id=75
20
+
21
+version:
22
+  friendly=0.1

+ 43
- 0
channelwho/src/com/dmdirc/addons/channelwho/ChannelWhoManager.java ファイルの表示

@@ -0,0 +1,43 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.addons.channelwho;
24
+
25
+import com.dmdirc.plugins.PluginDomain;
26
+
27
+import javax.inject.Inject;
28
+
29
+/**
30
+ * Provides channel who support in DMDirc.
31
+ */
32
+public class ChannelWhoManager {
33
+
34
+    @Inject
35
+    public ChannelWhoManager(@PluginDomain(ChannelWhoPlugin.class) final String domain) {
36
+    }
37
+
38
+    public void load() {
39
+    }
40
+
41
+    public void unload() {
42
+    }
43
+}

+ 47
- 0
channelwho/src/com/dmdirc/addons/channelwho/ChannelWhoModule.java ファイルの表示

@@ -0,0 +1,47 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.addons.channelwho;
24
+
25
+import com.dmdirc.ClientModule;
26
+import com.dmdirc.plugins.PluginDomain;
27
+
28
+import dagger.Module;
29
+import dagger.Provides;
30
+
31
+/**
32
+ * Dagger injection module for the Channel Who plugin.
33
+ */
34
+@Module(injects = ChannelWhoModule.class, addsTo = ClientModule.class)
35
+public class ChannelWhoModule {
36
+    private final String domain;
37
+
38
+    public ChannelWhoModule(final String domain) {
39
+        this.domain = domain;
40
+    }
41
+
42
+    @Provides
43
+    @PluginDomain(ChannelWhoPlugin.class)
44
+    public String getSettingsDomain() {
45
+        return domain;
46
+    }
47
+}

+ 54
- 0
channelwho/src/com/dmdirc/addons/channelwho/ChannelWhoPlugin.java ファイルの表示

@@ -0,0 +1,54 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.addons.channelwho;
24
+
25
+import com.dmdirc.plugins.PluginInfo;
26
+import com.dmdirc.plugins.implementations.BasePlugin;
27
+
28
+import dagger.ObjectGraph;
29
+
30
+/**
31
+ * Base Plugin for to provide Channel WHO support.
32
+ */
33
+public class ChannelWhoPlugin extends BasePlugin {
34
+
35
+    private ChannelWhoManager manager;
36
+
37
+    @Override
38
+    public void load(final PluginInfo pluginInfo, final ObjectGraph graph) {
39
+        super.load(pluginInfo, graph);
40
+
41
+        setObjectGraph(graph.plus(new ChannelWhoManager(pluginInfo.getDomain())));
42
+        manager = getObjectGraph().get(ChannelWhoManager.class);
43
+    }
44
+
45
+    @Override
46
+    public void onLoad() {
47
+        manager.load();
48
+    }
49
+
50
+    @Override
51
+    public void onUnload() {
52
+        manager.unload();
53
+    }
54
+}

+ 49
- 0
channelwho/test/com/dmdirc/addons/channelwho/ChannelWhoManagerTest.java ファイルの表示

@@ -0,0 +1,49 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.addons.channelwho;
24
+
25
+import org.junit.Before;
26
+import org.junit.Test;
27
+import org.junit.runner.RunWith;
28
+import org.mockito.runners.MockitoJUnitRunner;
29
+
30
+@RunWith(MockitoJUnitRunner.class)
31
+public class ChannelWhoManagerTest {
32
+
33
+    private ChannelWhoManager instance;
34
+
35
+    @Before
36
+    public void setUp() throws Exception {
37
+        instance = new ChannelWhoManager("test");
38
+    }
39
+
40
+    @Test
41
+    public void testLoad() throws Exception {
42
+
43
+    }
44
+
45
+    @Test
46
+    public void testUnload() throws Exception {
47
+
48
+    }
49
+}

読み込み中…
キャンセル
保存