Help with creating a plugin (my master thesis)

Agnieszka Pachuta pachuta.agnieszka at gmail.com
Thu Feb 20 18:46:35 EST 2014


Hi,

Your previous tips helped me a lot, but now I have some other problems with
my plugin.


1. I use receiving_im_msg_cb callback:

receiving_im_msg_cb(PurpleAccount *account, char **sender, char **buffer,
PurpleConversation *conv, PurpleMessageFlags *flags, void *data)

My idea is to check the type of message and send a proper message in this
function to execute the whole cryptographic protocol. However, when I send
the first initial message, the receiving_im_msg_cb is called, but the
PurpleConversation has not been created yet. (I can see in a debug window
that conversation_created_cb is called after receiving_im_msg_cb) When I
try to print conv->name or conv->type, I get an error and Pidgin stops
working. So I can't use this object and, in particular, I can't respond to
a message because purple_conv_im_send function takes a PurpleConversation
as an argument. How to deal with that?

Is it a good idea to create a PurpleConversation object on one's own? If
so, how to do that?


2. I use purple_conversation_set_data function to keep some additional data
connected to conversation (like a current state of the protocol). I would
also need to keep some data connected to people on a Buddy List (I mean I
need one additional variable for each buddy) Is it possible to do that?

Thank you in advance,
Agnieszka


On 4 February 2014 23:59, Agnieszka Pachuta <pachuta.agnieszka at gmail.com>wrote:

> Thank you very much for your quick response :) I will be in touch.
>
> Cheers,
> Agnieszka
>
>
> On 3 February 2014 12:56, Quentin Glidic <sardemff7+pidgin at sardemff7.net>wrote:
>
>> On 03/02/2014 02:29, Agnieszka Pachuta wrote:
>>
>>> Hi :)
>>>
>>
>> Hi,
>>
>>
>>
>>  My name is Agnieszka. I study Computer Science at University of
>>> Warsaw. As my master thesis, I'm going to create Pidgin plugin which
>>> implements a cryptographic protocol described in the following paper:
>>> https://eprint.iacr.org/2009/562.pdf (In short, I want to execute the
>>> protocol before the start of conversation in order to establish a
>>> secure communication key.) I've dug into libpurple code, but I still
>>> have some problems. I would really appreciate your help with some of
>>> them or just giving me some hints..
>>>
>>> 1. Is there any way to find out if a conversation partner has loaded
>>> my plugin? If the other person haven't loaded the plugin, he sees
>>> every message my plugin sent to him. I tried to use
>>> purple_conv_im_send_with_flags but the messages are still being
>>> displayed (maybe I don't know how to use these flags..) I know that
>>> I can cancel the message by returning TRUE in receiving_im_msg
>>> callback, but it will work only if the other person has loaded my
>>> plugin.
>>>
>>
>> It would require protocol specific support, and not all protocols can do
>> that. XMPP probably can with an extension.
>> I think a common practice is to send an handshake message with a human
>> readable part asking the user to install the plugin. If the handshake is
>> unsuccessful, the plugin can inform the sender user that the
>> conversation will not be secure.
>> You should look at the Pidgin-OTR plugin, they do something really
>> similar IIUC.
>>
>>
>>
>>  2. The protocol require users to solve captcha puzzles. To show the
>>> captcha image and get an answer from a user, I use
>>> purple_request_fields. However, when the pop-up shows, user is able
>>> to ignore it and start to communicate without solving a captcha. Is
>>> there any way to block the possibility of communication until he
>>> solves the captcha? I would like to wait for his answer somehow..
>>> One of solution to this problem is to display captcha image directly
>>> in the communication window. Is it possible?
>>>
>>
>> I think you can use purple_conv_im_write() with markup and flags to
>> display an image and just drop any outgoing message if it is not the
>> captcha, directly in the conversation window.
>>
>>
>>
>>  3. I would like to create my own libraries and linked them to my main
>>> plugin file. However, the example Makefile is really huge and I don't
>>> know how to do that. I'm stuck with this problem..
>>>
>>
>> In your case, I recommend to use a separate project with its own build
>> system. Here is a little plugin of mine which uses and provides a
>> library. It uses the GNU Autotools (you will need the autoconf,
>> automake and libtool packages installed on your system). The relevant
>> files are configure.ac and Makefile.am. They should be small enough to
>> be easy for you to understand even with basic Autotools knowledge.
>>
>> https://github.com/sardemff7/purple-events
>>
>> Here is a quick guide on Autotools:
>> https://www.flameeyes.eu/autotools-mythbuster/index.html
>>
>> Feel free to ask anything you might need, or to send over your files for
>> a review if you want.
>>
>>
>>
>>  I'm sorry for a lot of text. I'll appreciate any clue :)
>>>
>>
>> This is exactly what this mailing list is here for. :-)
>>
>>
>> Cheers,
>>
>> --
>>
>> Quentin "Sardem FF7" Glidic
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pidgin.im/pipermail/devel/attachments/20140221/2bfe831d/attachment.html>


More information about the Devel mailing list