source: skype/skype.c @ 2eb4b1f

Last change on this file since 2eb4b1f was 2eb4b1f, checked in by Miklos Vajna <vmiklos@…>, at 2008-02-29T00:34:31Z

add support for account set -del skype/call
to finish an outgoing call

  • Property mode set to 100644
File size: 30.8 KB
RevLine 
[7daec06]1/*
2 *  skype.c - Skype plugin for BitlBee
3 *
[680920f]4 *  Copyright (c) 2007, 2008 by Miklos Vajna <vmiklos@frugalware.org>
[f06e3ac]5 *
[7daec06]6 *  Several ideas are used from the BitlBee Jabber plugin, which is
7 *
8 *  Copyright (c) 2006 by Wilmer van der Gaast <wilmer@gaast.net>
9 *
10 *  This program is free software; you can redistribute it and/or modify
11 *  it under the terms of the GNU General Public License as published by
12 *  the Free Software Foundation; either version 2 of the License, or
13 *  (at your option) any later version.
14 *
15 *  This program is distributed in the hope that it will be useful,
16 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 *  GNU General Public License for more details.
19 *
20 *  You should have received a copy of the GNU General Public License
21 *  along with this program; if not, write to the Free Software
22 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
23 *  USA.
[f06e3ac]24 */
[7daec06]25
[f9c3e7b]26#define _XOPEN_SOURCE
[f06e3ac]27#include <stdio.h>
[ed2e37f]28#include <poll.h>
[f06e3ac]29#include <bitlbee.h>
[c7304b2]30#include <bitlbee/ssl_client.h>
[72aa7f0]31#include <glib.h>
[f06e3ac]32
[f5aedd91]33#define SKYPE_DEFAULT_SERVER "localhost"
[4bbd9db]34#define SKYPE_DEFAULT_PORT "2727"
[f06e3ac]35
[bbba374]36/*
37 * Enumerations
38 */
39
40typedef enum
41{
[df9255d]42        SKYPE_CALL_RINGING = 1,
[9db0234]43        SKYPE_CALL_MISSED,
44        SKYPE_CALL_UNPLACED,
[2eb4b1f]45        SKYPE_CALL_CANCELLED,
[9db0234]46        /* This means we are ringing somebody, not somebody rings us. */
47        SKYPE_CALL_RINGING_OUT
[bbba374]48} skype_call_status;
49
[df9255d]50typedef enum
51{
52        SKYPE_FILETRANSFER_NEW = 1,
53        SKYPE_FILETRANSFER_FAILED
54} skype_filetransfer_status;
55
[7daec06]56/*
57 * Structures
58 */
59
[f06e3ac]60struct skype_data
61{
62        struct im_connection *ic;
[a3d6427]63        char *username;
[368861e]64        /* The effective file descriptor. We store it here so any function can
65         * write() to it. */
[f06e3ac]66        int fd;
[368861e]67        /* File descriptor returned by bitlbee. we store it so we know when
68         * we're connected and when we aren't. */
69        int bfd;
[c7304b2]70        /* ssl_getfd() uses this to get the file desciptor. */
71        void *ssl;
[2a0f99c]72        /* When we receive a new message id, we query the properties, finally
73         * the chatname. Store the properties here so that we can use
[c81d0ef]74         * imcb_buddy_msg() when we got the chatname. */
[77c1abe]75        char *handle;
[a7af5f0]76        /* List, because of multiline messages. */
77        GList *body;
[2a0f99c]78        char *type;
[bbba374]79        /* This is necessary because we send a notification when we get the
80         * handle. So we store the state here and then we can send a
81         * notification about the handle is in a given status. */
82        skype_call_status call_status;
[2eb4b1f]83        char *call_id;
[df9255d]84        /* Same for file transfers. */
85        skype_filetransfer_status filetransfer_status;
[86278cd]86        /* Using /j #nick we want to have a groupchat with two people. Usually
87         * not (default). */
88        char* groupchat_with;
[f8674db]89        /* The user who invited us to the chat. */
90        char* adder;
[a5f76a2]91        /* If we are waiting for a confirmation about we changed the topic. */
92        int topic_wait;
[67454bd]93        /* These are used by the info command. */
94        char *info_fullname;
95        char *info_phonehome;
96        char *info_phoneoffice;
97        char *info_phonemobile;
98        char *info_nrbuddies;
99        char *info_tz;
100        char *info_seen;
101        char *info_birthday;
102        char *info_sex;
103        char *info_language;
104        char *info_country;
105        char *info_province;
106        char *info_city;
107        char *info_homepage;
108        char *info_about;
[f06e3ac]109};
110
[adce2de]111struct skype_away_state
112{
113        char *code;
114        char *full_name;
115};
116
[7daec06]117struct skype_buddy_ask_data
118{
119        struct im_connection *ic;
120        char *handle;
121};
122
123/*
124 * Tables
125 */
126
[adce2de]127const struct skype_away_state skype_away_state_list[] =
128{
129        { "ONLINE",  "Online" },
130        { "SKYPEME",  "Skype Me" },
131        { "AWAY",   "Away" },
132        { "NA",    "Not available" },
133        { "DND",      "Do Not Disturb" },
134        { "INVISIBLE",      "Invisible" },
[23411c6]135        { "OFFLINE",      "Offline" },
136        { NULL, NULL}
[adce2de]137};
138
[7daec06]139/*
140 * Functions
141 */
[d3cbd17]142
[f06e3ac]143int skype_write( struct im_connection *ic, char *buf, int len )
144{
145        struct skype_data *sd = ic->proto_data;
[1fb89e3]146        struct pollfd pfd[1];
147
148        pfd[0].fd = sd->fd;
149        pfd[0].events = POLLOUT;
[f06e3ac]150
[7daec06]151        /* This poll is necessary or we'll get a SIGPIPE when we write() to
152         * sd->fd. */
[1fb89e3]153        poll(pfd, 1, 1000);
154        if(pfd[0].revents & POLLHUP)
155        {
156                imc_logout( ic, TRUE );
157                return FALSE;
158        }
[c7304b2]159        ssl_write( sd->ssl, buf, len );
[f06e3ac]160
[9fd4241]161        return TRUE;
[f06e3ac]162}
163
[d3cbd17]164static void skype_buddy_ask_yes( gpointer w, struct skype_buddy_ask_data *bla )
165{
166        char *buf = g_strdup_printf("SET USER %s ISAUTHORIZED TRUE", bla->handle);
167        skype_write( bla->ic, buf, strlen( buf ) );
168        g_free(buf);
169        g_free(bla->handle);
170        g_free(bla);
171}
172
173static void skype_buddy_ask_no( gpointer w, struct skype_buddy_ask_data *bla )
174{
175        char *buf = g_strdup_printf("SET USER %s ISAUTHORIZED FALSE", bla->handle);
176        skype_write( bla->ic, buf, strlen( buf ) );
177        g_free(buf);
178        g_free(bla->handle);
179        g_free(bla);
180}
181
182void skype_buddy_ask( struct im_connection *ic, char *handle, char *message)
183{
184        struct skype_buddy_ask_data *bla = g_new0( struct skype_buddy_ask_data, 1 );
185        char *buf;
186
187        bla->ic = ic;
188        bla->handle = g_strdup(handle);
189
190        buf = g_strdup_printf( "The user %s wants to add you to his/her buddy list, saying: '%s'.", handle, message);
191        imcb_ask( ic, buf, bla, skype_buddy_ask_yes, skype_buddy_ask_no );
192        g_free( buf );
193}
194
[72aa7f0]195struct groupchat *skype_chat_by_name( struct im_connection *ic, char *name )
196{
197        struct groupchat *ret;
198
[de2f05e]199        for( ret = ic->groupchats; ret; ret = ret->next )
[72aa7f0]200        {
201                if(strcmp(name, ret->title ) == 0 )
202                        break;
203        }
204
205        return ret;
206}
207
[1323e36]208static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition cond )
209{
210        struct im_connection *ic = data;
211        struct skype_data *sd = ic->proto_data;
212        char buf[1024];
213        int st;
[9fd4241]214        char **lines, **lineptr, *line, *ptr;
[1323e36]215
[98bca36]216        if( !sd || sd->fd == -1 )
[1323e36]217                return FALSE;
[7daec06]218        /* Read the whole data. */
[c7304b2]219        st = ssl_read( sd->ssl, buf, sizeof( buf ) );
[1323e36]220        if( st > 0 )
221        {
222                buf[st] = '\0';
[7daec06]223                /* Then split it up to lines. */
[9fd4241]224                lines = g_strsplit(buf, "\n", 0);
225                lineptr = lines;
226                while((line = *lineptr))
227                {
228                        if(!strlen(line))
229                                break;
230                        if(!strncmp(line, "USERS ", 6))
231                        {
232                                char **i;
233                                char **nicks;
234
235                                nicks = g_strsplit(line + 6, ", ", 0);
236                                i = nicks;
237                                while(*i)
238                                {
239                                        g_snprintf(buf, 1024, "GET USER %s ONLINESTATUS\n", *i);
240                                        skype_write( ic, buf, strlen( buf ) );
241                                        i++;
242                                }
243                                g_strfreev(nicks);
244                        }
245                        else if(!strncmp(line, "USER ", 5))
246                        {
[adce2de]247                                int flags = 0;
[be975f8]248                                char *status = strrchr(line, ' ');
249                                char *user = strchr(line, ' ');
[adce2de]250                                status++;
[be975f8]251                                ptr = strchr(++user, ' ');
252                                *ptr = '\0';
[6627d92]253                                ptr++;
[7daec06]254                                if(!strncmp(ptr, "ONLINESTATUS ", 13) &&
255                                                strcmp(user, sd->username) != 0
256                                                && strcmp(user, "echo123") != 0)
[a3d6427]257                                {
258                                        ptr = g_strdup_printf("%s@skype.com", user);
259                                        imcb_add_buddy(ic, ptr, NULL);
260                                        if(strcmp(status, "OFFLINE") != 0)
261                                                flags |= OPT_LOGGED_IN;
262                                        if(strcmp(status, "ONLINE") != 0 && strcmp(status, "SKYPEME") != 0)
263                                                flags |= OPT_AWAY;
264                                        imcb_buddy_status(ic, ptr, flags, NULL, NULL);
265                                        g_free(ptr);
266                                }
[d3cbd17]267                                else if(!strncmp(ptr, "RECEIVEDAUTHREQUEST ", 20))
268                                {
269                                        char *message = ptr + 20;
270                                        if(strlen(message))
271                                                skype_buddy_ask(ic, user, message);
272                                }
273                                else if(!strncmp(ptr, "BUDDYSTATUS ", 12))
274                                {
275                                        char *st = ptr + 12;
276                                        if(!strcmp(st, "3"))
277                                        {
278                                                char *buf = g_strdup_printf("%s@skype.com", user);
279                                                imcb_add_buddy(ic, buf, NULL);
280                                                g_free(buf);
281                                        }
282                                }
[67454bd]283                                else if(!strncmp(ptr, "FULLNAME ", 9))
284                                        sd->info_fullname = g_strdup_printf("%s", ptr + 9);
[93052e1]285                                else if(!strncmp(ptr, "PHONE_HOME ", 11))
286                                        sd->info_phonehome = g_strdup_printf("%s", ptr + 11);
287                                else if(!strncmp(ptr, "PHONE_OFFICE ", 13))
288                                        sd->info_phoneoffice = g_strdup_printf("%s", ptr + 13);
289                                else if(!strncmp(ptr, "PHONE_MOBILE ", 13))
290                                        sd->info_phonemobile = g_strdup_printf("%s", ptr + 13);
291                                else if(!strncmp(ptr, "NROF_AUTHED_BUDDIES ", 20))
292                                        sd->info_nrbuddies = g_strdup_printf("%s", ptr + 20);
293                                else if(!strncmp(ptr, "TIMEZONE ", 9))
294                                        sd->info_tz = g_strdup_printf("%s", ptr + 9);
295                                else if(!strncmp(ptr, "LASTONLINETIMESTAMP ", 20))
296                                        sd->info_seen = g_strdup_printf("%s", ptr + 20);
297                                else if(!strncmp(ptr, "BIRTHDAY ", 9))
298                                        sd->info_birthday = g_strdup_printf("%s", ptr + 9);
299                                else if(!strncmp(ptr, "SEX ", 4))
300                                        sd->info_sex = g_strdup_printf("%s", ptr + 4);
301                                else if(!strncmp(ptr, "LANGUAGE ", 9))
302                                        sd->info_language = g_strdup_printf("%s", ptr + 9);
303                                else if(!strncmp(ptr, "COUNTRY ", 8))
304                                        sd->info_country = g_strdup_printf("%s", ptr + 8);
305                                else if(!strncmp(ptr, "PROVINCE ", 9))
306                                        sd->info_province = g_strdup_printf("%s", ptr + 9);
307                                else if(!strncmp(ptr, "CITY ", 5))
308                                        sd->info_city = g_strdup_printf("%s", ptr + 5);
309                                else if(!strncmp(ptr, "HOMEPAGE ", 9))
310                                        sd->info_homepage = g_strdup_printf("%s", ptr + 9);
[67454bd]311                                else if(!strncmp(ptr, "ABOUT ", 6))
312                                {
313                                        sd->info_about = g_strdup_printf("%s", ptr + 6);
314
[93052e1]315                                        GString *st = g_string_new("Contact Information\n");
[67454bd]316                                        g_string_append_printf(st, "Skype Name: %s\n", user);
317                                        if(sd->info_fullname)
318                                        {
[93052e1]319                                                if(strlen(sd->info_fullname))
320                                                        g_string_append_printf(st, "Full Name: %s\n", sd->info_fullname);
[67454bd]321                                                g_free(sd->info_fullname);
322                                        }
[93052e1]323                                        if(sd->info_phonehome)
324                                        {
325                                                if(strlen(sd->info_phonehome))
326                                                        g_string_append_printf(st, "Home Phone: %s\n", sd->info_phonehome);
327                                                g_free(sd->info_phonehome);
328                                        }
329                                        if(sd->info_phoneoffice)
330                                        {
331                                                if(strlen(sd->info_phoneoffice))
332                                                        g_string_append_printf(st, "Office Phone: %s\n", sd->info_phoneoffice);
333                                                g_free(sd->info_phoneoffice);
334                                        }
335                                        if(sd->info_phonemobile)
336                                        {
337                                                if(strlen(sd->info_phonemobile))
338                                                        g_string_append_printf(st, "Mobile Phone: %s\n", sd->info_phonemobile);
339                                                g_free(sd->info_phonemobile);
340                                        }
341                                        g_string_append_printf(st, "Personal Information\n");
342                                        if(sd->info_nrbuddies)
343                                        {
344                                                if(strlen(sd->info_nrbuddies))
345                                                        g_string_append_printf(st, "Contacts: %s\n", sd->info_nrbuddies);
346                                                g_free(sd->info_nrbuddies);
347                                        }
348                                        if(sd->info_tz)
349                                        {
350                                                if(strlen(sd->info_tz))
[885efac6]351                                                {
[33cac97]352                                                        char ib[256];
353                                                        time_t t = time(NULL);
354                                                        t += atoi(sd->info_tz)-(60*60*24);
355                                                        struct tm *gt = gmtime(&t);
356                                                        strftime(ib, 256, "%H:%M:%S", gt);
357                                                        g_string_append_printf(st, "Local Time: %s\n", ib);
[885efac6]358                                                }
[93052e1]359                                                g_free(sd->info_tz);
360                                        }
361                                        if(sd->info_seen)
362                                        {
363                                                if(strlen(sd->info_seen))
[885efac6]364                                                {
[3c5aded]365                                                        char ib[256];
366                                                        time_t it = atoi(sd->info_seen);
367                                                        struct tm *tm = localtime(&it);
368                                                        strftime(ib, 256, ("%Y. %m. %d. %H:%M"), tm);
369                                                        g_string_append_printf(st, "Last Seen: %s\n", ib);
[885efac6]370                                                }
[93052e1]371                                                g_free(sd->info_seen);
372                                        }
373                                        if(sd->info_birthday)
374                                        {
[969f643]375                                                if(strlen(sd->info_birthday) && strcmp(sd->info_birthday, "0"))
[885efac6]376                                                {
[f9c3e7b]377                                                        char ib[256];
378                                                        struct tm tm;
379                                                        strptime(sd->info_birthday, "%Y%m%d", &tm);
380                                                        strftime(ib, 256, "%B %d, %Y", &tm);
381                                                        g_string_append_printf(st, "Birthday: %s\n", ib);
[5b9847d]382
383                                                        strftime(ib, 256, "%Y", &tm);
384                                                        int year = atoi(ib);
385                                                        time_t t = time(NULL);
386                                                        struct tm *lt = localtime(&t);
387                                                        g_string_append_printf(st, "Age: %d\n", lt->tm_year+1900-year);
[885efac6]388                                                }
[93052e1]389                                                g_free(sd->info_birthday);
390                                        }
391                                        if(sd->info_sex)
392                                        {
393                                                if(strlen(sd->info_sex))
[885efac6]394                                                {
[6b43dd4]395                                                        char *iptr = sd->info_sex;
396                                                        while(*iptr++)
397                                                                *iptr = tolower(*iptr);
[93052e1]398                                                        g_string_append_printf(st, "Gender: %s\n", sd->info_sex);
[885efac6]399                                                }
[93052e1]400                                                g_free(sd->info_sex);
401                                        }
402                                        if(sd->info_language)
403                                        {
404                                                if(strlen(sd->info_language))
[885efac6]405                                                {
406                                                        char *iptr = strchr(sd->info_language, ' ');
407                                                        if(iptr)
408                                                                iptr++;
409                                                        else
410                                                                iptr = sd->info_language;
411                                                        g_string_append_printf(st, "Language: %s\n", iptr);
412                                                }
[93052e1]413                                                g_free(sd->info_language);
414                                        }
415                                        if(sd->info_country)
416                                        {
417                                                if(strlen(sd->info_country))
[885efac6]418                                                {
419                                                        char *iptr = strchr(sd->info_country, ' ');
420                                                        if(iptr)
421                                                                iptr++;
422                                                        else
423                                                                iptr = sd->info_country;
[191470d]424                                                        g_string_append_printf(st, "Country: %s\n", iptr);
[885efac6]425                                                }
[93052e1]426                                                g_free(sd->info_country);
427                                        }
428                                        if(sd->info_province)
429                                        {
430                                                if(strlen(sd->info_province))
431                                                        g_string_append_printf(st, "Region: %s\n", sd->info_province);
432                                                g_free(sd->info_province);
433                                        }
434                                        if(sd->info_city)
435                                        {
436                                                if(strlen(sd->info_city))
437                                                        g_string_append_printf(st, "City: %s\n", sd->info_city);
438                                                g_free(sd->info_city);
439                                        }
440                                        if(sd->info_homepage)
441                                        {
442                                                if(strlen(sd->info_homepage))
443                                                        g_string_append_printf(st, "Homepage: %s\n", sd->info_homepage);
444                                                g_free(sd->info_homepage);
445                                        }
446                                        if(sd->info_about)
447                                        {
448                                                if(strlen(sd->info_about))
449                                                        g_string_append_printf(st, "%s\n", sd->info_about);
450                                                g_free(sd->info_about);
451                                        }
[67454bd]452                                        imcb_log(ic, "%s", st->str);
453                                        g_string_free(st, TRUE);
454                                }
[9fd4241]455                        }
[77c1abe]456                        else if(!strncmp(line, "CHATMESSAGE ", 12))
457                        {
458                                char *id = strchr(line, ' ');
459                                if(++id)
460                                {
461                                        char *info = strchr(id, ' ');
462                                        *info = '\0';
463                                        info++;
464                                        if(!strcmp(info, "STATUS RECEIVED"))
465                                        {
[7daec06]466                                                /* New message ID:
467                                                 * (1) Request its from field
468                                                 * (2) Request its body
[2a0f99c]469                                                 * (3) Request its type
470                                                 * (4) Query chatname
[7daec06]471                                                 */
[77c1abe]472                                                g_snprintf(buf, 1024, "GET CHATMESSAGE %s FROM_HANDLE\n", id);
473                                                skype_write( ic, buf, strlen( buf ) );
474                                                g_snprintf(buf, 1024, "GET CHATMESSAGE %s BODY\n", id);
475                                                skype_write( ic, buf, strlen( buf ) );
[2a0f99c]476                                                g_snprintf(buf, 1024, "GET CHATMESSAGE %s TYPE\n", id);
477                                                skype_write( ic, buf, strlen( buf ) );
[c81d0ef]478                                                g_snprintf(buf, 1024, "GET CHATMESSAGE %s CHATNAME\n", id);
479                                                skype_write( ic, buf, strlen( buf ) );
[77c1abe]480                                        }
481                                        else if(!strncmp(info, "FROM_HANDLE ", 12))
482                                        {
483                                                info += 12;
[7daec06]484                                                /* New from field value. Store
485                                                 * it, then we can later use it
486                                                 * when we got the message's
487                                                 * body. */
[7613670]488                                                g_free(sd->handle);
[77c1abe]489                                                sd->handle = g_strdup_printf("%s@skype.com", info);
[5d1b0774]490                                        }
491                                        else if(!strncmp(info, "EDITED_BY ", 10))
492                                        {
493                                                info += 10;
494                                                /* This is the same as
495                                                 * FROM_HANDLE, except that we
496                                                 * never request these lines
497                                                 * from Skype, we just get
498                                                 * them. */
499                                                g_free(sd->handle);
500                                                sd->handle = g_strdup_printf("%s@skype.com", info);
[77c1abe]501                                        }
502                                        else if(!strncmp(info, "BODY ", 5))
503                                        {
504                                                info += 5;
[a7af5f0]505                                                sd->body = g_list_append(sd->body, g_strdup(info));
[c81d0ef]506                                        }
[2a0f99c]507                                        else if(!strncmp(info, "TYPE ", 5))
508                                        {
509                                                info += 5;
510                                                g_free(sd->type);
511                                                sd->type = g_strdup(info);
512                                        }
[c81d0ef]513                                        else if(!strncmp(info, "CHATNAME ", 9))
514                                        {
515                                                info += 9;
[2a0f99c]516                                                if(sd->handle && sd->body && sd->type)
[7daec06]517                                                {
[31870ae]518                                                        struct groupchat *gc = skype_chat_by_name(ic, info);
[a7af5f0]519                                                        int i;
520                                                        for(i=0;i<g_list_length(sd->body);i++)
[2a0f99c]521                                                        {
[a7af5f0]522                                                                char *body = g_list_nth_data(sd->body, i);
[54e6207]523                                                                if(!strcmp(sd->type, "SAID") || !strcmp(sd->type, "EMOTED"))
[a7af5f0]524                                                                {
[54e6207]525                                                                        char *st;
526                                                                        if(!strcmp(sd->type, "SAID"))
527                                                                                st = g_strdup(body);
528                                                                        else
529                                                                        {
530                                                                                st = g_strdup_printf("/me %s", body);
531                                                                        }
[a7af5f0]532                                                                        if(!gc)
533                                                                                /* Private message */
[54e6207]534                                                                                imcb_buddy_msg(ic, sd->handle, st, 0, 0);
[a7af5f0]535                                                                        else
536                                                                                /* Groupchat message */
[54e6207]537                                                                                imcb_chat_msg(gc, sd->handle, st, 0, 0);
538                                                                        g_free(st);
[a7af5f0]539                                                                }
540                                                                else if(!strcmp(sd->type, "SETTOPIC"))
541                                                                {
542                                                                        if(gc)
[de2f05e]543                                                                                imcb_chat_topic(gc, sd->handle, body, 0);
[a7af5f0]544                                                                }
545                                                                else if(!strcmp(sd->type, "LEFT"))
546                                                                {
547                                                                        if(gc)
548                                                                                imcb_chat_remove_buddy(gc, sd->handle, NULL);
549                                                                }
[2a0f99c]550                                                        }
[a7af5f0]551                                                        g_list_free(sd->body);
552                                                        sd->body = NULL;
[7daec06]553                                                }
[77c1abe]554                                        }
555                                }
556                        }
[ecfbc5d]557                        else if(!strncmp(line, "CALL ", 5))
558                        {
559                                char *id = strchr(line, ' ');
560                                if(++id)
561                                {
562                                        char *info = strchr(id, ' ');
563                                        *info = '\0';
564                                        info++;
565                                        if(!strcmp(info, "STATUS RINGING"))
566                                        {
567                                                g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id);
568                                                skype_write( ic, buf, strlen( buf ) );
[9db0234]569                                                if(sd->call_status != SKYPE_CALL_UNPLACED)
570                                                        sd->call_status = SKYPE_CALL_RINGING;
571                                                else
572                                                        sd->call_status = SKYPE_CALL_RINGING_OUT;
[bbba374]573                                        }
574                                        else if(!strcmp(info, "STATUS MISSED"))
575                                        {
576                                                g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id);
577                                                skype_write( ic, buf, strlen( buf ) );
578                                                sd->call_status = SKYPE_CALL_MISSED;
[ecfbc5d]579                                        }
[2eb4b1f]580                                        else if(!strcmp(info, "STATUS CANCELLED"))
581                                        {
582                                                g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id);
583                                                skype_write( ic, buf, strlen( buf ) );
584                                                sd->call_status = SKYPE_CALL_CANCELLED;
585                                        }
[9db0234]586                                        else if(!strcmp(info, "STATUS UNPLACED"))
[2eb4b1f]587                                        {
588                                                if(sd->call_id)
589                                                        g_free(sd->call_id);
590                                                /* Save the ID for later usage (Cancel/Finish). */
591                                                sd->call_id = g_strdup(id);
[9db0234]592                                                sd->call_status = SKYPE_CALL_UNPLACED;
[2eb4b1f]593                                        }
[ecfbc5d]594                                        else if(!strncmp(info, "PARTNER_HANDLE ", 15))
595                                        {
596                                                info += 15;
[df9255d]597                                                if(sd->call_status) {
598                                                        switch(sd->call_status)
599                                                        {
600                                                                case SKYPE_CALL_RINGING:
601                                                                        imcb_log(ic, "The user %s is currently ringing you.", info);
602                                                                        break;
603                                                                case SKYPE_CALL_MISSED:
604                                                                        imcb_log(ic, "You have missed a call from user %s.", info);
605                                                                        break;
[9db0234]606                                                                case SKYPE_CALL_RINGING_OUT:
607                                                                        imcb_log(ic, "You are currently ringing the user %s.", info);
608                                                                        break;
[2eb4b1f]609                                                                case SKYPE_CALL_CANCELLED:
610                                                                        imcb_log(ic, "You cancelled the call to the user %s.", info);
611                                                                        break;
[9db0234]612                                                                default:
613                                                                        /* Don't be noisy, ignore other statuses for now. */
614                                                                        break;
[df9255d]615                                                        }
616                                                        sd->call_status = 0;
617                                                }
618                                        }
619                                }
620                        }
621                        else if(!strncmp(line, "FILETRANSFER ", 13))
622                        {
623                                char *id = strchr(line, ' ');
624                                if(++id)
625                                {
626                                        char *info = strchr(id, ' ');
627                                        *info = '\0';
628                                        info++;
629                                        if(!strcmp(info, "STATUS NEW"))
630                                        {
631                                                g_snprintf(buf, 1024, "GET FILETRANSFER %s PARTNER_HANDLE\n", id);
632                                                skype_write( ic, buf, strlen( buf ) );
633                                                sd->filetransfer_status = SKYPE_FILETRANSFER_NEW;
634                                        }
635                                        else if(!strcmp(info, "STATUS FAILED"))
636                                        {
637                                                g_snprintf(buf, 1024, "GET FILETRANSFER %s PARTNER_HANDLE\n", id);
638                                                skype_write( ic, buf, strlen( buf ) );
639                                                sd->filetransfer_status = SKYPE_FILETRANSFER_FAILED;
640                                        }
641                                        else if(!strncmp(info, "PARTNER_HANDLE ", 15))
642                                        {
643                                                info += 15;
644                                                if(sd->filetransfer_status) {
645                                                        switch(sd->filetransfer_status)
646                                                        {
647                                                                case SKYPE_FILETRANSFER_NEW:
648                                                                        imcb_log(ic, "The user %s offered a new file for you.", info);
649                                                                        break;
650                                                                case SKYPE_FILETRANSFER_FAILED:
651                                                                        imcb_log(ic, "Failed to transfer file from user %s.", info);
652                                                                        break;
653                                                        }
654                                                        sd->filetransfer_status = 0;
[bbba374]655                                                }
[ecfbc5d]656                                        }
657                                }
658                        }
[2d07803]659                        else if(!strncmp(line, "CHAT ", 5))
660                        {
661                                char *id = strchr(line, ' ');
662                                if(++id)
663                                {
664                                        char *info = strchr(id, ' ');
[86f2683]665                                        if(info)
666                                                *info = '\0';
[2d07803]667                                        info++;
[5652d43]668                                        /* Remove fake chat if we created one in skype_chat_with() */
669                                        struct groupchat *gc = skype_chat_by_name(ic, "");
670                                        if(gc)
671                                                imcb_chat_free(gc);
[5a61e43f]672                                        if(!strcmp(info, "STATUS MULTI_SUBSCRIBED"))
[72aa7f0]673                                        {
[86278cd]674                                                imcb_chat_new( ic, id );
[f8674db]675                                                g_snprintf(buf, 1024, "GET CHAT %s ADDER\n", id);
676                                                skype_write(ic, buf, strlen(buf));
677                                                g_snprintf(buf, 1024, "GET CHAT %s TOPIC\n", id);
678                                                skype_write(ic, buf, strlen(buf));
[86278cd]679                                        }
680                                        else if(!strcmp(info, "STATUS DIALOG") && sd->groupchat_with)
681                                        {
[5652d43]682                                                gc = imcb_chat_new( ic, id );
[86278cd]683                                                /* According to the docs this
684                                                 * is necessary. However it
685                                                 * does not seem the situation
686                                                 * and it would open an extra
687                                                 * window on our client, so
688                                                 * just leave it out. */
689                                                /*g_snprintf(buf, 1024, "OPEN CHAT %s\n", id);
690                                                skype_write(ic, buf, strlen(buf));*/
691                                                g_snprintf(buf, 1024, "%s@skype.com", sd->groupchat_with);
692                                                imcb_chat_add_buddy(gc, buf);
693                                                imcb_chat_add_buddy(gc, sd->username);
694                                                g_free(sd->groupchat_with);
695                                                sd->groupchat_with = NULL;
[f8674db]696                                                g_snprintf(buf, 1024, "GET CHAT %s ADDER\n", id);
697                                                skype_write(ic, buf, strlen(buf));
698                                                g_snprintf(buf, 1024, "GET CHAT %s TOPIC\n", id);
699                                                skype_write(ic, buf, strlen(buf));
[72aa7f0]700                                        }
[ec159f1]701                                        else if(!strcmp(info, "STATUS UNSUBSCRIBED"))
702                                        {
[5652d43]703                                                gc = skype_chat_by_name(ic, id);
[ec159f1]704                                                if(gc)
705                                                        gc->data = (void*)FALSE;
706                                        }
[f8674db]707                                        else if(!strncmp(info, "ADDER ", 6))
708                                        {
709                                                info += 6;
710                                                g_free(sd->adder);
711                                                sd->adder = g_strdup_printf("%s@skype.com", info);
712                                        }
[d601f9b]713                                        else if(!strncmp(info, "TOPIC ", 6))
714                                        {
715                                                info += 6;
[5652d43]716                                                gc = skype_chat_by_name(ic, id);
[a5f76a2]717                                                if(gc && (sd->adder || sd->topic_wait))
[f8674db]718                                                {
[a5f76a2]719                                                        if(sd->topic_wait)
720                                                        {
721                                                                sd->adder = g_strdup(sd->username);
722                                                                sd->topic_wait = 0;
723                                                        }
724                                                        imcb_chat_topic(gc, sd->adder, info, 0);
[f8674db]725                                                        g_free(sd->adder);
726                                                        sd->adder = NULL;
727                                                }
[d601f9b]728                                        }
[72aa7f0]729                                        else if(!strncmp(info, "ACTIVEMEMBERS ", 14))
730                                        {
731                                                info += 14;
[5652d43]732                                                gc = skype_chat_by_name(ic, id);
[ec159f1]733                                                /* Hack! We set ->data to TRUE
734                                                 * while we're on the channel
735                                                 * so that we won't rejoin
736                                                 * after a /part. */
737                                                if(gc && !gc->data)
[72aa7f0]738                                                {
[349ee4a]739                                                        char **members = g_strsplit(info, " ", 0);
740                                                        int i;
741                                                        for(i=0;members[i];i++)
742                                                        {
743                                                                if(!strcmp(members[i], sd->username))
744                                                                        continue;
745                                                                g_snprintf(buf, 1024, "%s@skype.com", members[i]);
[c09d327]746                                                                if(!g_list_find_custom(gc->in_room, buf, (GCompareFunc)strcmp))
747                                                                        imcb_chat_add_buddy(gc, buf);
[349ee4a]748                                                        }
749                                                        imcb_chat_add_buddy(gc, sd->username);
750                                                        g_strfreev(members);
[72aa7f0]751                                                }
752                                        }
[2d07803]753                                }
754                        }
[c7304b2]755                        else if(!strncmp(line, "PASSWORD ", 9))
756                        {
757                                if(!strncmp(line+9, "OK", 2))
758                                        imcb_connected(ic);
759                                else
760                                {
761                                        imcb_error(ic, "Authentication Failed");
762                                        imc_logout( ic, TRUE );
763                                }
764                        }
[9fd4241]765                        lineptr++;
766                }
767                g_strfreev(lines);
[1323e36]768        }
769        else if( st == 0 || ( st < 0 && !sockerr_again() ) )
770        {
771                closesocket( sd->fd );
772                sd->fd = -1;
773
774                imcb_error( ic, "Error while reading from server" );
775                imc_logout( ic, TRUE );
776                return FALSE;
777        }
778        return TRUE;
779}
780
[f06e3ac]781gboolean skype_start_stream( struct im_connection *ic )
782{
[1323e36]783        struct skype_data *sd = ic->proto_data;
[f06e3ac]784        char *buf;
785        int st;
786
[1fb89e3]787        if(!sd)
788                return FALSE;
789
[368861e]790        if( sd->bfd <= 0 )
791                sd->bfd = b_input_add( sd->fd, GAIM_INPUT_READ, skype_read_callback, ic );
[1323e36]792
[a0b206b]793        /* Log in */
794        buf = g_strdup_printf("USERNAME %s\n", ic->acc->user);
795        st = skype_write( ic, buf, strlen( buf ) );
796        g_free(buf);
797        buf = g_strdup_printf("PASSWORD %s\n", ic->acc->pass);
798        st = skype_write( ic, buf, strlen( buf ) );
799        g_free(buf);
800
[7daec06]801        /* This will download all buddies. */
[9fd4241]802        buf = g_strdup_printf("SEARCH FRIENDS\n");
[f06e3ac]803        st = skype_write( ic, buf, strlen( buf ) );
804        g_free(buf);
[348a3a2]805        buf = g_strdup_printf("SET USERSTATUS ONLINE\n");
806        skype_write( ic, buf, strlen( buf ) );
807        g_free(buf);
[f06e3ac]808        return st;
809}
810
[c7304b2]811gboolean skype_connected( gpointer data, void *source, b_input_condition cond )
[f06e3ac]812{
813        struct im_connection *ic = data;
[c7304b2]814        struct skype_data *sd = ic->proto_data;
815        if(!source)
816        {
817                sd->ssl = NULL;
818                imcb_error( ic, "Could not connect to server" );
819                imc_logout( ic, TRUE );
820                return FALSE;
821        }
822        imcb_log( ic, "Connected to server, logging in" );
[f06e3ac]823        return skype_start_stream(ic);
824}
825
826static void skype_login( account_t *acc )
827{
828        struct im_connection *ic = imcb_new( acc );
829        struct skype_data *sd = g_new0( struct skype_data, 1 );
830
831        ic->proto_data = sd;
832
833        imcb_log( ic, "Connecting" );
[c7304b2]834        sd->ssl = ssl_connect(set_getstr( &acc->set, "server" ), set_getint( &acc->set, "port" ), skype_connected, ic );
835        sd->fd = sd->ssl ? ssl_getfd( sd->ssl ) : -1;
[a3d6427]836        sd->username = g_strdup( acc->user );
[f06e3ac]837
838        sd->ic = ic;
839}
840
841static void skype_logout( struct im_connection *ic )
842{
843        struct skype_data *sd = ic->proto_data;
[98bca36]844        char *buf;
845
846        buf = g_strdup_printf("SET USERSTATUS OFFLINE\n");
847        skype_write( ic, buf, strlen( buf ) );
848        g_free(buf);
849
[a3d6427]850        g_free(sd->username);
[7613670]851        g_free(sd->handle);
[f06e3ac]852        g_free(sd);
[98bca36]853        ic->proto_data = NULL;
[f06e3ac]854}
855
[93ece66]856static int skype_buddy_msg( struct im_connection *ic, char *who, char *message, int flags )
857{
[77c1abe]858        char *buf, *ptr, *nick;
[93ece66]859        int st;
860
[cbec0d6]861        nick = g_strdup(who);
[77c1abe]862        ptr = strchr(nick, '@');
[0bb1b7f]863        if(ptr)
864                *ptr = '\0';
[93ece66]865
[77c1abe]866        buf = g_strdup_printf("MESSAGE %s %s\n", nick, message);
867        g_free(nick);
[93ece66]868        st = skype_write( ic, buf, strlen( buf ) );
869        g_free(buf);
870
871        return st;
872}
873
[23411c6]874const struct skype_away_state *skype_away_state_by_name( char *name )
875{
876        int i;
877
878        for( i = 0; skype_away_state_list[i].full_name; i ++ )
879                if( g_strcasecmp( skype_away_state_list[i].full_name, name ) == 0 )
880                        return( skype_away_state_list + i );
881
882        return NULL;
883}
884
[f06e3ac]885static void skype_set_away( struct im_connection *ic, char *state_txt, char *message )
886{
[23411c6]887        const struct skype_away_state *state;
888        char *buf;
889
890        if( strcmp( state_txt, GAIM_AWAY_CUSTOM ) == 0 )
891                state = skype_away_state_by_name( "Away" );
892        else
893                state = skype_away_state_by_name( state_txt );
894        buf = g_strdup_printf("SET USERSTATUS %s\n", state->code);
895        skype_write( ic, buf, strlen( buf ) );
896        g_free(buf);
[f06e3ac]897}
898
899static GList *skype_away_states( struct im_connection *ic )
900{
[de2f05e]901        static GList *l = NULL;
[adce2de]902        int i;
903       
[de2f05e]904        if( l == NULL )
905                for( i = 0; skype_away_state_list[i].full_name; i ++ )
906                        l = g_list_append( l, (void*) skype_away_state_list[i].full_name );
[adce2de]907       
[f06e3ac]908        return l;
909}
910
[93dffea]911static char *skype_set_display_name( set_t *set, char *value )
912{
913        account_t *acc = set->data;
914        struct im_connection *ic = acc->ic;
915        char *buf;
916
[fcef6e6]917        buf = g_strdup_printf("SET PROFILE FULLNAME %s", value);
[93dffea]918        skype_write( ic, buf, strlen( buf ) );
919        g_free(buf);
920        return(value);
921}
922
[b68b023]923static char *skype_set_call( set_t *set, char *value )
924{
925        account_t *acc = set->data;
926        struct im_connection *ic = acc->ic;
[2eb4b1f]927        struct skype_data *sd = ic->proto_data;
[b68b023]928        char *nick, *ptr, *buf;
929
[2eb4b1f]930        if(value)
[b68b023]931        {
[2eb4b1f]932                user_t *u = user_find(acc->irc, value);
933                /* We are starting a call */
934                if(!u)
935                {
936                        imcb_error(ic, "%s - no such nick", value);
937                        return(value);
938                }
939                nick = g_strdup(u->handle);
940                ptr = strchr(nick, '@');
941                if(ptr)
942                        *ptr = '\0';
943
944                buf = g_strdup_printf("CALL %s", nick);
945                skype_write( ic, buf, strlen( buf ) );
946                g_free(buf);
947                g_free(nick);
948        }
949        else
950        {
951                /* We are ending a call */
952                if(sd->call_id)
953                {
954                        buf = g_strdup_printf("SET CALL %s STATUS FINISHED", sd->call_id);
955                        skype_write( ic, buf, strlen( buf ) );
956                        g_free(buf);
957                }
958                else
959                {
960                        imcb_error(ic, "There are no active calls currently.");
961                }
[b68b023]962        }
963        return(value);
964}
965
[f06e3ac]966static void skype_add_buddy( struct im_connection *ic, char *who, char *group )
967{
[6627d92]968        char *buf, *nick, *ptr;
969
[cbec0d6]970        nick = g_strdup(who);
[6627d92]971        ptr = strchr(nick, '@');
972        if(ptr)
973                *ptr = '\0';
974        buf = g_strdup_printf("SET USER %s BUDDYSTATUS 2 Please authorize me\n", nick);
975        skype_write( ic, buf, strlen( buf ) );
976        g_free(nick);
[f06e3ac]977}
978
979static void skype_remove_buddy( struct im_connection *ic, char *who, char *group )
980{
[6627d92]981        char *buf, *nick, *ptr;
982
[cbec0d6]983        nick = g_strdup(who);
[6627d92]984        ptr = strchr(nick, '@');
985        if(ptr)
986                *ptr = '\0';
987        buf = g_strdup_printf("SET USER %s BUDDYSTATUS 1\n", nick);
988        skype_write( ic, buf, strlen( buf ) );
989        g_free(nick);
[f06e3ac]990}
991
[79e20f9]992void skype_chat_msg( struct groupchat *gc, char *message, int flags )
[66c9558]993{
[79e20f9]994        struct im_connection *ic = gc->ic;
995        char *buf;
996        buf = g_strdup_printf("CHATMESSAGE %s %s\n", gc->title, message);
997        skype_write( ic, buf, strlen( buf ) );
998        g_free(buf);
[66c9558]999}
1000
[b01dc6c]1001void skype_chat_leave( struct groupchat *gc )
1002{
1003        struct im_connection *ic = gc->ic;
1004        char *buf;
1005        buf = g_strdup_printf("ALTER CHAT %s LEAVE\n", gc->title);
1006        skype_write( ic, buf, strlen( buf ) );
1007        g_free(buf);
[760319d]1008        gc->data = (void*)TRUE;
1009}
1010
1011void skype_chat_invite(struct groupchat *gc, char *who, char *message)
1012{
1013        struct im_connection *ic = gc->ic;
1014        char *buf, *ptr, *nick;
1015        nick = g_strdup(message);
1016        ptr = strchr(nick, '@');
1017        if(ptr)
1018                *ptr = '\0';
1019        buf = g_strdup_printf("ALTER CHAT %s ADDMEMBERS %s\n", gc->title, nick);
1020        skype_write( ic, buf, strlen( buf ) );
1021        g_free(buf);
1022        g_free(nick);
[b01dc6c]1023}
1024
[09e2a69]1025void skype_chat_topic(struct groupchat *gc, char *message)
1026{
1027        struct im_connection *ic = gc->ic;
[a5f76a2]1028        struct skype_data *sd = ic->proto_data;
[09e2a69]1029        char *buf;
1030        buf = g_strdup_printf("ALTER CHAT %s SETTOPIC %s\n", gc->title, message);
1031        skype_write( ic, buf, strlen( buf ) );
1032        g_free(buf);
[a5f76a2]1033        sd->topic_wait = 1;
[09e2a69]1034}
1035
[86278cd]1036struct groupchat *skype_chat_with(struct im_connection *ic, char *who)
1037{
1038        struct skype_data *sd = ic->proto_data;
1039        char *ptr, *nick, *buf;
1040        nick = g_strdup(who);
1041        ptr = strchr(nick, '@');
1042        if(ptr)
1043                *ptr = '\0';
1044        buf = g_strdup_printf("CHAT CREATE %s\n", nick);
1045        skype_write(ic, buf, strlen(buf));
1046        g_free(buf);
1047        sd->groupchat_with = g_strdup(nick);
1048        g_free(nick);
[5652d43]1049        /* We create a fake chat for now. We will replace it with a real one in
1050         * the real callback. */
1051        return(imcb_chat_new( ic, "" ));
[86278cd]1052}
1053
[67454bd]1054static void skype_get_info(struct im_connection *ic, char *who)
1055{
1056        char *ptr, *nick, *buf;
1057        nick = g_strdup(who);
1058        ptr = strchr(nick, '@');
1059        if(ptr)
1060                *ptr = '\0';
1061        buf = g_strdup_printf("GET USER %s FULLNAME\n", nick);
1062        skype_write(ic, buf, strlen(buf));
1063        g_free(buf);
1064        buf = g_strdup_printf("GET USER %s PHONE_HOME\n", nick);
1065        skype_write(ic, buf, strlen(buf));
1066        g_free(buf);
1067        buf = g_strdup_printf("GET USER %s PHONE_OFFICE\n", nick);
1068        skype_write(ic, buf, strlen(buf));
1069        g_free(buf);
1070        buf = g_strdup_printf("GET USER %s PHONE_MOBILE\n", nick);
1071        skype_write(ic, buf, strlen(buf));
1072        g_free(buf);
1073        buf = g_strdup_printf("GET USER %s NROF_AUTHED_BUDDIES\n", nick);
1074        skype_write(ic, buf, strlen(buf));
1075        g_free(buf);
1076        buf = g_strdup_printf("GET USER %s TIMEZONE\n", nick);
1077        skype_write(ic, buf, strlen(buf));
1078        g_free(buf);
1079        buf = g_strdup_printf("GET USER %s LASTONLINETIMESTAMP\n", nick);
1080        skype_write(ic, buf, strlen(buf));
1081        g_free(buf);
1082        buf = g_strdup_printf("GET USER %s BIRTHDAY\n", nick);
1083        skype_write(ic, buf, strlen(buf));
1084        g_free(buf);
1085        buf = g_strdup_printf("GET USER %s SEX\n", nick);
1086        skype_write(ic, buf, strlen(buf));
1087        g_free(buf);
1088        buf = g_strdup_printf("GET USER %s LANGUAGE\n", nick);
1089        skype_write(ic, buf, strlen(buf));
1090        g_free(buf);
1091        buf = g_strdup_printf("GET USER %s COUNTRY\n", nick);
1092        skype_write(ic, buf, strlen(buf));
1093        g_free(buf);
1094        buf = g_strdup_printf("GET USER %s PROVINCE\n", nick);
1095        skype_write(ic, buf, strlen(buf));
1096        g_free(buf);
1097        buf = g_strdup_printf("GET USER %s CITY\n", nick);
1098        skype_write(ic, buf, strlen(buf));
1099        g_free(buf);
1100        buf = g_strdup_printf("GET USER %s HOMEPAGE\n", nick);
1101        skype_write(ic, buf, strlen(buf));
1102        g_free(buf);
1103        buf = g_strdup_printf("GET USER %s ABOUT\n", nick);
1104        skype_write(ic, buf, strlen(buf));
1105        g_free(buf);
1106}
1107
[93dffea]1108static void skype_set_my_name( struct im_connection *ic, char *info )
1109{
1110        skype_set_display_name( set_find( &ic->acc->set, "display_name" ), info );
1111}
1112
1113static void skype_init( account_t *acc )
1114{
1115        set_t *s;
1116
1117        s = set_add( &acc->set, "server", SKYPE_DEFAULT_SERVER, set_eval_account, acc );
1118        s->flags |= ACC_SET_OFFLINE_ONLY;
1119
1120        s = set_add( &acc->set, "port", SKYPE_DEFAULT_PORT, set_eval_int, acc );
1121        s->flags |= ACC_SET_OFFLINE_ONLY;
1122
1123        s = set_add( &acc->set, "display_name", NULL, skype_set_display_name, acc );
1124        s->flags |= ACC_SET_NOSAVE | ACC_SET_ONLINE_ONLY;
[b68b023]1125
1126        s = set_add( &acc->set, "call", NULL, skype_set_call, acc );
1127        s->flags |= ACC_SET_NOSAVE | ACC_SET_ONLINE_ONLY;
[93dffea]1128}
1129
[f06e3ac]1130void init_plugin(void)
1131{
1132        struct prpl *ret = g_new0( struct prpl, 1 );
1133
1134        ret->name = "skype";
1135        ret->login = skype_login;
1136        ret->init = skype_init;
1137        ret->logout = skype_logout;
[93ece66]1138        ret->buddy_msg = skype_buddy_msg;
[67454bd]1139        ret->get_info = skype_get_info;
[93dffea]1140        ret->set_my_name = skype_set_my_name;
[f06e3ac]1141        ret->away_states = skype_away_states;
[7daec06]1142        ret->set_away = skype_set_away;
[f06e3ac]1143        ret->add_buddy = skype_add_buddy;
1144        ret->remove_buddy = skype_remove_buddy;
[66c9558]1145        ret->chat_msg = skype_chat_msg;
[b01dc6c]1146        ret->chat_leave = skype_chat_leave;
[760319d]1147        ret->chat_invite = skype_chat_invite;
[86278cd]1148        ret->chat_with = skype_chat_with;
[f06e3ac]1149        ret->handle_cmp = g_strcasecmp;
[09e2a69]1150        ret->chat_topic = skype_chat_topic;
[f06e3ac]1151        register_protocol( ret );
1152}
[6172871]1153
1154/* vim: set ts=2 sw=2 noet: */
Note: See TracBrowser for help on using the repository browser.