Ignore:
Timestamp:
2015-11-21T00:01:50Z (8 years ago)
Author:
dequis <dx@…>
Parents:
e4f08bf (diff), 8fdeaa5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into feat/hip-cat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/skype/skype.c

    re4f08bf r29ff5c2  
    2121
    2222#define _XOPEN_SOURCE
    23 #define _BSD_SOURCE
    2423#include <poll.h>
    2524#include <stdio.h>
     
    188187
    189188        va_start(args, fmt);
    190         vsnprintf(str, IRC_LINE_SIZE, fmt, args);
     189        g_vsnprintf(str, IRC_LINE_SIZE, fmt, args);
    191190        va_end(args);
    192191
     
    322321        }
    323322        return NULL;
     323}
     324
     325static struct groupchat *skype_chat_get_or_create(struct im_connection *ic, char *id)
     326{
     327        struct skype_data *sd = ic->proto_data;
     328        struct groupchat *gc = bee_chat_by_title(ic->bee, ic, id);
     329
     330        if (!gc) {
     331                gc = imcb_chat_new(ic, id);
     332                imcb_chat_name_hint(gc, id);
     333                imcb_chat_add_buddy(gc, sd->username);
     334
     335                skype_printf(ic, "GET CHAT %s ADDER\n", id);
     336                skype_printf(ic, "GET CHAT %s TOPIC\n", id);
     337                skype_printf(ic, "GET CHAT %s ACTIVEMEMBERS\n", id);
     338        }
     339
     340        return gc;
    324341}
    325342
     
    688705                info += 9;
    689706                if (sd->handle && sd->body && sd->type) {
    690                         struct groupchat *gc = bee_chat_by_title(ic->bee, ic, info);
     707                        struct groupchat *gc = skype_chat_get_or_create(ic, info);
    691708                        int i;
    692709                        for (i = 0; i < g_list_length(sd->body); i++) {
     
    10261043        }
    10271044        if (!strcmp(info, "STATUS MULTI_SUBSCRIBED")) {
    1028                 gc = bee_chat_by_title(ic->bee, ic, id);
    1029                 if (!gc) {
    1030                         gc = imcb_chat_new(ic, id);
    1031                         imcb_chat_name_hint(gc, id);
    1032                 }
    1033                 skype_printf(ic, "GET CHAT %s ADDER\n", id);
    1034                 skype_printf(ic, "GET CHAT %s TOPIC\n", id);
     1045                skype_chat_get_or_create(ic, id);
    10351046        } else if (!strcmp(info, "STATUS DIALOG") && sd->groupchat_with) {
    1036                 gc = imcb_chat_new(ic, id);
    1037                 imcb_chat_name_hint(gc, id);
     1047                gc = skype_chat_get_or_create(ic, id);
    10381048                /* According to the docs this
    10391049                 * is necessary. However it
     
    10461056                           sd->groupchat_with);
    10471057                imcb_chat_add_buddy(gc, buf);
    1048                 imcb_chat_add_buddy(gc, sd->username);
    10491058                g_free(sd->groupchat_with);
    10501059                sd->groupchat_with = NULL;
    1051                 skype_printf(ic, "GET CHAT %s ADDER\n", id);
    1052                 skype_printf(ic, "GET CHAT %s TOPIC\n", id);
    10531060        } else if (!strcmp(info, "STATUS UNSUBSCRIBED")) {
    10541061                gc = bee_chat_by_title(ic->bee, ic, id);
     
    12571264                }
    12581265                g_strfreev(lines);
    1259         } else if (st == 0 || (st < 0 && !sockerr_again())) {
     1266        } else if (st == 0 || (st < 0 && !ssl_sockerr_again(sd->ssl))) {
    12601267                ssl_disconnect(sd->ssl);
    12611268                sd->fd = -1;
Note: See TracChangeset for help on using the changeset viewer.