Protocol Plugin for http based chat application.

karthik kumar kumarkarthikn at gmail.com
Wed Oct 19 21:54:09 EDT 2011


Hi Eion,
   Thanks a lot for sharing those.  Really really useful to me.
"what chat application" . Am really sorry I am not in a position to reveal
that since its not yet out. I will inform surely once its out.

For now I will go through the source codes,
As far i know, i ll have a directory
 pidgin-2.10.0/libpurple/protocols/MYChat and will have my code.
Can you please advice what my Makefile should contain

Thanks
Karthik.


On Thu, Oct 20, 2011 at 12:41 AM, Eion Robb <eion at robbmob.com> wrote:

> Hi there,
>
> I've written a few protocol plugins that connect to HTTP services.  Feel
> free to use them as examples on how to write your own plugin:
> http://code.google.com/p/pidgin-facebookchat/
> http://code.google.com/p/okcupid-pidgin/
> http://code.google.com/p/pidgin-ning/
> http://code.google.com/p/pidgin-omegle/
> http://code.google.com/p/pidgin-wordfeud/
>
> Just to be curious, what's the 'chat application' you're writing the plugin
> for?
>
> On 20 October 2011 03:04, karthik kumar <kumarkarthikn at gmail.com> wrote:
>
>> Hi,
>>     I am newbie here. I have been trying to create a protocol plugin for
>> our chat application which is based on http. I have gone through the
>> document 'Pidgin C How to' and libpurple/protocol/null  and few other
>> protocol plugins. I have some questions.
>>
>> 1. What's exactly a protocol plugin - it contains definitions of events or
>> actions like incoming_im_msg()  buddy_comes_online() and so on for our own
>> protocol (http). Protocol plugin is loaded and keeps running waiting for
>> incoming_im_msg() and other events which we have defined. If an event
>> happens it sends out signal to UI. AM I Correct ????
>>
> Kinda.  Unlike a normal plugin, a protocol plugin can be run multiple
> times, after a user adds a new account that uses that protocol plugin and
> can add multiple accounts with that plugin.  It sets up the
> PurplePluginProtocolInfo struct with functions that the UI
> (Pidgin/Adium/InstantBird etc) will call when it wants to perform certain
> actions, like make the account go offline.  The plugin can be loaded when
> the UI starts, but won't necessairly need to listen to events from the
> server until the account has gone online.
>
>
>>
>> 2. I am not sure on what to write on  protocol plugin with C program.
>>     curl  url  -> gives me an xml it contains event type and
>> data.(event=incoming chat, msg=xxxxxx)
>>     parse the xml and get the event and msg.
>>
> If it's an xml response, it's much easier to handle in libpurple than JSON,
> since libpurple has an xml parser built in.  Have a look at
> libpurple/xmlnode.h.
>
>
>>  Can someone give me a small idea of what needs to be done for this to be
>> written on C program.
>>
>>
>> Thanks
>> Karthik.
>>
>>
>>
>> _______________________________________________
>> Devel mailing list
>> Devel at pidgin.im
>> http://pidgin.im/cgi-bin/mailman/listinfo/devel
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20111020/206cc4ec/attachment-0002.html>


More information about the Devel mailing list