Ignore:
Timestamp:
2010-07-24T14:06:22Z (9 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
7989d40d
Parents:
c8791f2
Message:

Adding protocol-specific chatroom settings. First one to use this: AIM
chatrooms to use exchange numbers other than 4.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/oscar/oscar.c

    rc8791f2 r03f3828  
    25062506}
    25072507
    2508 struct groupchat *oscar_chat_join(struct im_connection * ic, const char * room, const char * nick, const char * password )
     2508struct groupchat *oscar_chat_join_internal(struct im_connection *ic, const char *room,
     2509        const char *nick, const char *password, int exchange_number)
    25092510{
    25102511        struct oscar_data * od = (struct oscar_data *)ic->proto_data;
     
    25142515                int st;
    25152516               
    2516                 st = aim_chatnav_createroom(od->sess, cur, room, 4);
     2517                st = aim_chatnav_createroom(od->sess, cur, room, exchange_number);
    25172518               
    25182519                return NULL;
     
    25202521                struct create_room * cr = g_new0(struct create_room, 1);
    25212522               
    2522                 cr->exchange = 4;
     2523                cr->exchange = exchange_number;
    25232524                cr->name = g_strdup(room);
    25242525                od->create_rooms = g_slist_append(od->create_rooms, cr);
     
    25292530}
    25302531
     2532struct groupchat *oscar_chat_join(struct im_connection *ic, const char *room,
     2533        const char *nick, const char *password, set_t **sets)
     2534{
     2535        return oscar_chat_join_internal(ic, room, nick, password, set_getint(sets, "exchange_number"));
     2536}
     2537
    25312538struct groupchat *oscar_chat_with(struct im_connection * ic, char *who)
    25322539{
     
    25452552       
    25462553        c = imcb_chat_new(ic, chatname);
    2547         ret = oscar_chat_join(ic, chatname, NULL, NULL);
     2554        ret = oscar_chat_join_internal(ic, chatname, NULL, NULL, 4);
    25482555        aim_chat_invite(od->sess, od->conn, who, "", 4, chatname, 0x0);
    25492556
     
    25572564        struct aim_chat_invitation * inv = data;
    25582565       
    2559         oscar_chat_join(inv->ic, inv->name, NULL, NULL);
     2566        oscar_chat_join_internal(inv->ic, inv->name, NULL, NULL, 4);
    25602567        g_free(inv->name);
    25612568        g_free(inv);
     
    25682575        g_free(inv->name);
    25692576        g_free(inv);
     2577}
     2578
     2579void oscar_chat_add_settings(account_t *acc, set_t **head)
     2580{
     2581        set_add(head, "exchange_number", "4", set_eval_int, NULL);
     2582}
     2583
     2584void oscar_chat_free_settings(account_t *acc, set_t **head)
     2585{
     2586        set_del(head, "exchange_number");
    25702587}
    25712588
     
    25902607        ret->chat_with = oscar_chat_with;
    25912608        ret->chat_join = oscar_chat_join;
     2609        ret->chat_add_settings = oscar_chat_add_settings;
     2610        ret->chat_free_settings = oscar_chat_free_settings;
    25922611        ret->add_permit = oscar_add_permit;
    25932612        ret->add_deny = oscar_add_deny;
Note: See TracChangeset for help on using the changeset viewer.