A few notes on the issue of Instant Messaging.
Even before I started writing plug E-mail I knew to write a universal plugin for IM is a problem. Unlike the E-mails are not for IM almost no Python modules (libraries). E-mail has the one great advantage, unlike IM: It is uniform and it does not matter what kind of who uses the e-mail service, the e-mail client and even the OS. If everything is all right, the message will be delivered to its addressee. By contrast, in the IM is a large number of mutually incompatible networks. It is impossible to write a relatively simple plug-in such a way that it could be used by any user of the program EventGhost. For example, in our country are very few extended service WLM. Are much more widespread ICQ and Jabber. User Jabber service can not send a message to the user services WLM.
Therefore, I first made plugin purely for e-mail. I think, that the result is not bad, but probably will be some mistake somewhere. There is no reaction to it, and even negative. I don't know what is the cause. Maybe one can not use it without instructions? Maybe nobody needs him? Can you please someone explain?
Now back to the IM.
I reached the decision that implant the IM to E-mail plugin is not reasonable. I think it will better do for IM plugin completely separate. Of course, I have nothing against that someone made a universal plugin for E-mail and IM. If better, we can mine E-mail plugin drop.
I am looking for solutions to make a plugin for the IM and I found perhaps the most viable solution:
Plugin for IM should be aligned on a universal IM client. The great advantage of this way is that the plugin may
not "know" the various IM services, or protocols. This would arrange the client.
I was looking for a suitable (the most universal) IM client, and yet it seems like the best client Pidgin:
http://www.pidgin.im/.
To try this option, I did a simple script that works as an interface between Pidgin and EventGhost. If Pidgin take a new message, the script generates for EventGhost an event.
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1487">
<Folder Name="Test Pidgin" Expanded="True">
<Macro Name="Find Window: pidgin.exe" Expanded="True">
<Action>
EventGhost.PythonScript(u"from threading import Thread, Event\nfrom win32gui import GetWindowText\nkey = u'[NewMail]'\nfindPidginWin = eg.WindowMatcher(u'pidgin.exe', key+u'{*}', u'gdkWindowToplevel', None, None, 1, True, 0.0, 0)\nclass MyThread(Thread):\n def __init__(self):\n Thread.__init__(self, name = 'MyThread')\n self.event = Event()\n \n def run(self):\n cnt = 0\n while True:\n hwnds = findPidginWin()\n if len(hwnds) != 0:\n title = GetWindowText(hwnds[0])\n end = title.find(']',len(key))\n count = title[len(key)+1:end]\n if count > cnt:\n cnt = count\n eg.TriggerEvent('Pidgin',count)\n else:\n cnt = 0\n self.event.wait(5)\n self.event.clear()\n \n\nmt = MyThread()\nmt.start()\n")
</Action>
</Macro>
<Macro Name="New messages !!!" Expanded="True">
<Event Name="Main.Pidgin" />
<Action>
EventGhost.ShowOSD(u'{eg.event.payload} new messages !!!', u'0;-37;0;0;0;700;0;0;0;238;3;2;1;66;Comic Sans MS', (0, 255, 64), (0, 0, 0), 0, (0, 0), 0, 10.0, True)
</Action>
</Macro>
</Folder>
</EventGhost>
To script work, you must configure Pidgin. You can do this according to the attached screenshots.
If you should go this way, it would be necessary to do the plugin on Pidgin side too. Then, it would certainly be able to transmit to EventGhost not only the information that came the report, but also for example its content and the sender. The problem is that the Pidgin plugins are written in C and C language I not understand. Would had to take it someone else.
I therefore ask:
1) It my idea, do plugin linked to IM client reasonable?
2a) If yes, do you agree with the choice of the client (Pidgin), or you know a more appropriate?
2b) If not, what solution you propose?
3) If 1) and 2a) is right, it is necessary to create a plugin for Pidgin. Find we someone, who will do it? Perhaps it would not be a big problem, it is possible to inspire the many existing plugins.
Pako