Closed triplem closed 11 years ago
closes #13 as well.
I have commited this change in the wrong branch and therefor reverted it, thats why the new pull request does contain the same changes again. This time these are right ;-)
I used object, because otherwise the wanted functionality is not working (this seems to be a bug in the pkgconfig package or I did missunderstood something).
You are right on the method, I would just cleanly separay the pluginname and the pluginProperty and therefor the 1 param is the pluginname and the second just the pluginProperty without the name prefix. In the above example it would then be something like:
irc.getPluginConfig('freenode', 'nickPass');
I am just thinking about moving this whole plugin stuff into its own super class which should then be used for all plugins, since e.g. the Help functionality and also the properties could then be handled in a central manner.
Added a new composite PluginHelper, which is added to each plugin (contains already the name of the plugin) instead of the irc class. this module contains a function to determine the pluginProperties.
Furthermore I added a new plugin (admin) and a couple of new functionatlity to the freenode plugin.
What do you think?
next step is now to add some testcases for plugins.
any chance to meet in irc?
tk on FreeNode I'll try and watch for messages (working a bit now)
Jeez, should do smaller commits and take more care about pwd stuff. Well, it is changed anyway to a very secure one. LOL. Sure, the method in the PluginHelper should replace the one in irc.js. I was thinking about a central method in irc and a more specified one in PluginHelper. Unfortunately JS inheritance is not really as nice, otherwise I would have made an constructor chain for the plugins. Inow used the composite stuff, but unfortunately the irc class knows about the PluginHelper. Anyway, the PluginHelper will provide more methods for eg messagesplitting and stuff like already done in several plugins.
LOL, Well I review pull requests for part of my job, so I try to catch things like that ;) Also thats not a bad idea... I wonder if Compose is usable in Node... I shall check that out.. .I do like being able to easily handle inheritance and it would certainly make something like this much more clean I believe and modularized....
use already existing freenode plugin, instead of own functionality in irc.js. move classes (*js) from main directory to lib directory.