problem with PURPLE_MESSAGE_AUTO_RESP

View: New views
2 Messages — Rating Filter:   Alert me  

problem with PURPLE_MESSAGE_AUTO_RESP

by Kim Stebel :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Hello List!

I'd like to ask for your help with a problem with a plugin I wrote. This plugin replies to certain messages automatically and this can get into an infinite loop if both users use the plugin. I thought this could be fixed like that:

/*Sending*/
PurpleMessageFlags flags = PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_AUTO_RESP;
serv_send_im(gc, who, reply, flag);
purple_debug_misc(PLUGIN_ID, "flags sent = %d\n", flags);



/*Receiving*/
purple_debug_misc(PLUGIN_ID, "flags received = %d\n", flags);
if (flags & PURPLE_MESSAGE_AUTO_RESP) {
        return; //do not send autoreply message
}

Unfortunately it doesn't work. The flags received don't match the flags sent. I get sent = 9 and received = 2. Please enlighten me.

Kim

_______________________________________________
Devel mailing list
Devel@...
http://pidgin.im/cgi-bin/mailman/listinfo/devel

Re: problem with PURPLE_MESSAGE_AUTO_RESP

by Ka-Hing Cheung-3 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

On Mon, 2009-09-28 at 17:13 +0200, Kim Stebel wrote:

> Hello List!
>
> I'd like to ask for your help with a problem with a plugin I wrote. This plugin replies to certain messages automatically and this can get into an infinite loop if both users use the plugin. I thought this could be fixed like that:
>
> /*Sending*/
> PurpleMessageFlags flags = PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_AUTO_RESP;
> serv_send_im(gc, who, reply, flag);
> purple_debug_misc(PLUGIN_ID, "flags sent = %d\n", flags);
>
>
>
> /*Receiving*/
> purple_debug_misc(PLUGIN_ID, "flags received = %d\n", flags);
> if (flags & PURPLE_MESSAGE_AUTO_RESP) {
> return; //do not send autoreply message
> }
>
> Unfortunately it doesn't work. The flags received don't match the flags sent. I get sent = 9 and received = 2. Please enlighten me.

Most protocols don't actually carry this flag over. This probably only
works for AIM.

-khc


_______________________________________________
Devel mailing list
Devel@...
http://pidgin.im/cgi-bin/mailman/listinfo/devel