diff options
author | dequis <dx@dxzone.com.ar> | 2015-03-09 05:35:50 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-04-10 14:10:40 -0300 |
commit | 11e42dcf7366ee547b9651648724d35d12e36091 (patch) | |
tree | afc7c81e586d1fb119c5e2856be0742db9963430 /protocols/msn/msn.c | |
parent | 254a4dab408b67f78b94054514bbf6f629dd6bba (diff) |
msn: removed switchboards, implemented SDG message
Diffstat (limited to 'protocols/msn/msn.c')
-rw-r--r-- | protocols/msn/msn.c | 80 |
1 files changed, 12 insertions, 68 deletions
diff --git a/protocols/msn/msn.c b/protocols/msn/msn.c index ef78646b..c1b5ce77 100644 --- a/protocols/msn/msn.c +++ b/protocols/msn/msn.c @@ -29,7 +29,6 @@ int msn_chat_id; GSList *msn_connections; -GSList *msn_switchboards; static char *set_eval_display_name(set_t *set, char *value); @@ -47,7 +46,6 @@ static void msn_init(account_t *acc) s->flags |= ACC_SET_OFFLINE_ONLY; set_add(&acc->set, "mail_notifications", "false", set_eval_bool, acc); - set_add(&acc->set, "switchboard_keepalives", "false", set_eval_bool, acc); acc->flags |= ACC_FLAG_AWAY_MESSAGE | ACC_FLAG_STATUS_MESSAGE | ACC_FLAG_HANDLE_DOMAINS; @@ -79,12 +77,12 @@ static void msn_login(account_t *acc) md->ic = ic; md->away_state = msn_away_state_list; md->domaintree = g_tree_new(msn_domaintree_cmp); - md->ns->fd = -1; + md->fd = -1; msn_connections = g_slist_prepend(msn_connections, ic); imcb_log(ic, "Connecting"); - msn_ns_connect(ic, md->ns, server, + msn_ns_connect(ic, server, set_getint(&ic->acc->set, "port")); } @@ -95,11 +93,7 @@ static void msn_logout(struct im_connection *ic) int i; if (md) { - msn_ns_close(md->ns); - - while (md->switchboards) { - msn_sb_destroy(md->switchboards->data); - } + msn_ns_close(md); msn_msgq_purge(ic, &md->msgq); msn_soapq_flush(ic, FALSE); @@ -153,29 +147,15 @@ static void msn_logout(struct im_connection *ic) static int msn_buddy_msg(struct im_connection *ic, char *who, char *message, int away) { struct bee_user *bu = bee_user_by_handle(ic->bee, ic, who); - struct msn_buddy_data *bd = bu ? bu->data : NULL; - struct msn_switchboard *sb; #ifdef DEBUG if (strcmp(who, "raw") == 0) { msn_ns_write(ic, -1, "%s\r\n", message); - } else -#endif - if (bd && bd->flags & MSN_BUDDY_FED) { - msn_ns_sendmessage(ic, bu, message); - } else if ((sb = msn_sb_by_handle(ic, who))) { - return(msn_sb_sendmessage(sb, message)); - } else { - struct msn_message *m; - - /* Create a message. We have to arrange a usable switchboard, and send the message later. */ - m = g_new0(struct msn_message, 1); - m->who = g_strdup(who); - m->text = g_strdup(message); - - return msn_sb_write_msg(ic, m); + return 0; } +#endif + msn_ns_sendmessage(ic, bu, message); return(0); } @@ -197,7 +177,7 @@ static GList *msn_away_states(struct im_connection *ic) static void msn_set_away(struct im_connection *ic, char *state, char *message) { - char *uux; + //char *uux; struct msn_data *md = ic->proto_data; if (state == NULL) { @@ -257,53 +237,24 @@ static void msn_remove_buddy(struct im_connection *ic, char *who, char *group) static void msn_chat_msg(struct groupchat *c, char *message, int flags) { - struct msn_switchboard *sb = msn_sb_by_chat(c); - - if (sb) { - msn_sb_sendmessage(sb, message); - } - /* FIXME: Error handling (although this can't happen unless something's - already severely broken) disappeared here! */ + /* TODO: groupchats*/ } static void msn_chat_invite(struct groupchat *c, char *who, char *message) { - struct msn_switchboard *sb = msn_sb_by_chat(c); - - if (sb) { - msn_sb_write(sb, "CAL %d %s\r\n", ++sb->trId, who); - } + /* TODO: groupchats*/ } static void msn_chat_leave(struct groupchat *c) { - struct msn_switchboard *sb = msn_sb_by_chat(c); - - if (sb) { - msn_sb_write(sb, "OUT\r\n"); - } + /* TODO: groupchats*/ } static struct groupchat *msn_chat_with(struct im_connection *ic, char *who) { - struct msn_switchboard *sb; + /* TODO: groupchats*/ struct groupchat *c = imcb_chat_new(ic, who); - - if ((sb = msn_sb_by_handle(ic, who))) { - debug("Converting existing switchboard to %s to a groupchat", who); - return msn_sb_to_chat(sb); - } else { - struct msn_message *m; - - /* Create a magic message. This is quite hackish, but who cares? :-P */ - m = g_new0(struct msn_message, 1); - m->who = g_strdup(who); - m->text = g_strdup(GROUPCHAT_SWITCHBOARD_MESSAGE); - - msn_sb_write_msg(ic, m); - - return c; - } + return c; } static void msn_keepalive(struct im_connection *ic) @@ -323,14 +274,7 @@ static void msn_rem_permit(struct im_connection *ic, char *who) static void msn_add_deny(struct im_connection *ic, char *who) { - struct msn_switchboard *sb; - msn_buddy_list_add(ic, MSN_BUDDY_BL, who, who, NULL); - - /* If there's still a conversation with this person, close it. */ - if ((sb = msn_sb_by_handle(ic, who))) { - msn_sb_destroy(sb); - } } static void msn_rem_deny(struct im_connection *ic, char *who) |