Skype Plugin

Evan Schoenberg evands at
Thu Sep 13 22:43:52 EDT 2007

On Sep 13, 2007, at 10:19 PM, Eion Robb wrote:

> Skype needs to make a connection before it starts sending chat  
> messages,
> not dissimilar to MSN.  Is it up to the plugin to manage these
> connections, or can libpurple manage it by using the chat_* functions?

I'm not 100% sure what your requirements are, but generally libpurple  
sends a single command to the protocol plugin ("prpl") and is hands- 
off after that point.  The prpl should set up whatever connections it  
needs and, once those are set up, finish up what it was instructed to  
do ('send an IM to this buddy').  In MSN, for example,  
() is passed the text along with the switchboard and does:

	if (msn_switchboard_can_send(swboard))
		release_msg(swboard, msg);
	else if (queue)
		queue_msg(swboard, msg);

when the switchboard is ready to send, it releases its queue of  
messages.  Does that answer your question?

> Every chat session in Skype is potentially a multi-user chatroom.   
> Do I
> just implement the join_chat,chat_send functions or is it best to
> implement the skype_send_im function too?

This might be the hardest part of the plugin in terms of interfacing  
with libpurple; group chat is one of the remaining areas in which  
libpurple still shows its AIM roots.  In AIM, there's a bright line  
between one-to-one chats and multi-user chats.  Other protocols, such  
as MSN, which have a more dynamic concept of multi-user chats,  
currently implement messaging thusly:
  1) Implement the send_im function
  2) Have a contact action which "initiates a multi-user chat"
  3) Utilize this action to create a new  PurpleConversation,  
immediately adding the contact in question, and therefore setting up  
for inviting more people.

chat_send and send_im can therefore be simple wrappers on some more  
generic sending function, but for now both will need to be implemented.

Appropriately blurring the artificial distinction between IM and Group  
Chat which currently exists would be a good thing... so if you'd like  
to tackle it yourself or start a discussion on how best to accomplish  
that, it would be welcomed :)

> Skype uses different protocols for interacting with the Skype  
> process on
> different OS's Is there a good way of detecting which OS that  
> libpurple is
> running on?  I've only found G_OS_WIN32 and __OBJC__ #def's so far.
There are a number of utility functions in util.c:
purple_running_osx()  (If using the define for Mac OS X, I'd use  
__APPLE__ rather than __OBJC__

You might find it useful to add purple_running_windows() for  
parallelism in the code... though others might consider that  
unnecessary public API.

> Last question: I can't find what function i need to call in  
> libpurple to
> add contacts to the list.  Can someone point me to the right page in  
> the
> doc's?

purple_blist_add_buddy() from blist.h is probably what you want.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Devel mailing list