From: Mark D. <ma...@ki...> - 2005-06-23 03:36:59
|
On Wed, 22 Jun 2005 21:15:57 -0600, David Everly wrote > On Wed, Jun 22, 2005 at 04:50:55PM -0500, Mark Doliner wrote: > > On Tue, 21 Jun 2005 05:55:15 -0600, David Everly wrote > > > Hello, > > > > > > I'm working on a plugin whose purpose is to suppress unwanted spam > > > bot IMs. Somewhat of a simple pop up blocker. > > > > > > The user defines a simple question and an answer. When an unknown > > > person (not in the buddy or permit lists) sends an IM, it is saved, but > > > not displayed and no window pops up. An IM with the question is > > > sent to this unknown person, and future IMs from that person are > > > ignored until an IM with the correct answer is sent from that > > > person. When the correct answer is received, another IM is sent to > > > that person indicating that the answer was correct, delivery of the > > > first message will proceed and there will be no further impediments > > > to conversing. The correct answer is then replaced by the first > > > message from the unknown user and the IM is allowed to proceed, > > > which opens a conversation and a window for it pops up. > > > > > > This seems to work with all the prpls (yahoo, irc, etc.). > > > > > > My problem is that since there is no conversation (because that would > > > pop up an IM window) I think I'm forced to use serv_send_im() to > > > communicate with the unknown user. This causes problems when using > > > gaim-otr, because perhaps encryption has engaged, but here is my plugin > > > sending un-encrypted messages. It has been suggested to use > > > gaim_conv_im_send(), but of course this requires a conversation, > > > which opens a window--somewhat defeating to the entire purpose of > > > the plugin. > > > > > > Is there any nice way to fix this in my plugin, while using existing > > > gaim-1.3.1? > > > > > > Here is the source, if it would help: > > > > > > > > http://svn.berlios.de/viewcvs/qrc/trunk/bot-challenger/bot-challenger.c?view=markup > > > > Could you create a conversation if one does not exist, and then always use > > gaim_conv_im_send()? > > Won't that cause an IM window to open? Good point. I should have known that was too obvious to work. I guess there's probably not an easy way around that. But you sound smart... maybe you could find a way around that and provide a patch to Gaim? Maybe the "sending-im-msg" signal should be emitted from serv_send_im? Maybe serv_send_im should be moved to conversation.c and renamed to gaim_conv_send_im_for_real (or something), and then the signal should be emitted from there? I just throwing out ideas--don't treat these as gospel. -Mark |