comparison src/protocols/msn/msn.c @ 4508:4c40fccbd7c9

[gaim-migrate @ 4784] We don't actually want file transfer anymore. More trouble than it's worth, so we decided to just pull it, rather than deal with the support "requests" (read: complaints). committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 02 Feb 2003 07:43:27 +0000
parents 3196d9044a45
children 86b0a0243be8
comparison
equal deleted inserted replaced
4507:1761c8cb8a23 4508:4c40fccbd7c9
141 char *friend; 141 char *friend;
142 }; 142 };
143 143
144 static void msn_login_callback(gpointer, gint, GaimInputCondition); 144 static void msn_login_callback(gpointer, gint, GaimInputCondition);
145 static void msn_login_xfr_connect(gpointer, gint, GaimInputCondition); 145 static void msn_login_xfr_connect(gpointer, gint, GaimInputCondition);
146
147 #if 0
146 static struct msn_file_transfer *find_mft_by_cookie(struct gaim_connection *gc, 148 static struct msn_file_transfer *find_mft_by_cookie(struct gaim_connection *gc,
147 unsigned long cookie); 149 unsigned long cookie);
148 static struct msn_file_transfer *find_mft_by_xfer(struct gaim_connection *gc, 150 static struct msn_file_transfer *find_mft_by_xfer(struct gaim_connection *gc,
149 struct file_transfer *xfer); 151 struct file_transfer *xfer);
152 #endif
150 153
151 #define GET_NEXT(tmp) while (*(tmp) && *(tmp) != ' ') \ 154 #define GET_NEXT(tmp) while (*(tmp) && *(tmp) != ' ') \
152 (tmp)++; \ 155 (tmp)++; \
153 *(tmp)++ = 0; \ 156 *(tmp)++ = 0; \
154 while (*(tmp) && *(tmp) == ' ') \ 157 while (*(tmp) && *(tmp) == ' ') \
638 cur = url_decode(ret->str); 641 cur = url_decode(ret->str);
639 g_string_free(ret, TRUE); 642 g_string_free(ret, TRUE);
640 return cur; 643 return cur;
641 } 644 }
642 645
646 #if 0
643 static int msn_process_msnftp(struct msn_file_transfer *mft, char *buf) 647 static int msn_process_msnftp(struct msn_file_transfer *mft, char *buf)
644 { 648 {
645 struct gaim_connection *gc = mft->gc; 649 struct gaim_connection *gc = mft->gc;
646 char sendbuf[MSN_BUF_LEN]; 650 char sendbuf[MSN_BUF_LEN];
647 651
870 * file transfers. 874 * file transfers.
871 */ 875 */
872 } 876 }
873 } 877 }
874 } 878 }
879 #endif
875 880
876 static void msn_process_switch_msg(struct msn_switchboard *ms, char *msg) 881 static void msn_process_switch_msg(struct msn_switchboard *ms, char *msg)
877 { 882 {
878 char *content, *agent, *format; 883 char *content, *agent, *format;
879 char *message = NULL; 884 char *message = NULL;
903 } 908 }
904 909
905 } else if (!g_strncasecmp(content, "Content-Type: text/x-msmsgsinvite;", 910 } else if (!g_strncasecmp(content, "Content-Type: text/x-msmsgsinvite;",
906 strlen("Content-Type: text/x-msmsgsinvite;"))) { 911 strlen("Content-Type: text/x-msmsgsinvite;"))) {
907 912
913 #if 0
908 /* 914 /*
909 * NOTE: Other things, such as voice communication, would go in 915 * NOTE: Other things, such as voice communication, would go in
910 * here too (since they send the same Content-Type). However, 916 * here too (since they send the same Content-Type). However,
911 * this is the best check for file transfer messages, so I'm 917 * this is the best check for file transfer messages, so I'm
912 * calling msn_process_ft_invite_msg(). If anybody adds support 918 * calling msn_process_ft_invite_msg(). If anybody adds support
913 * for anything else that sends a text/x-msmsgsinvite, perhaps 919 * for anything else that sends a text/x-msmsgsinvite, perhaps
914 * this should be changed. For now, it stays. 920 * this should be changed. For now, it stays.
915 */ 921 */
916 msn_process_ft_msg(ms, content); 922 msn_process_ft_msg(ms, content);
923 #endif
917 924
918 } else if (!g_strncasecmp(content, "Content-Type: text/plain", 925 } else if (!g_strncasecmp(content, "Content-Type: text/plain",
919 strlen("Content-Type: text/plain"))) { 926 strlen("Content-Type: text/plain"))) {
920 927
921 928
2054 if (msn_write(ms->fd, buf, strlen(buf)) < 0) 2061 if (msn_write(ms->fd, buf, strlen(buf)) < 0)
2055 msn_kill_switch(ms); 2062 msn_kill_switch(ms);
2056 return MSN_TYPING_SEND_TIMEOUT; 2063 return MSN_TYPING_SEND_TIMEOUT;
2057 } 2064 }
2058 2065
2066 #if 0
2059 /* XXX Don't blame me. I stole this from the oscar module! */ 2067 /* XXX Don't blame me. I stole this from the oscar module! */
2060 static struct msn_file_transfer *find_mft_by_xfer(struct gaim_connection *gc, 2068 static struct msn_file_transfer *find_mft_by_xfer(struct gaim_connection *gc,
2061 struct file_transfer *xfer) 2069 struct file_transfer *xfer)
2062 { 2070 {
2063 GSList *g = ((struct msn_data *)gc->proto_data)->file_transfers; 2071 GSList *g = ((struct msn_data *)gc->proto_data)->file_transfers;
2251 2259
2252 for (len = 0; len < size; len += read(fd, *buf + len, size - len)); 2260 for (len = 0; len < size; len += read(fd, *buf + len, size - len));
2253 2261
2254 return len; 2262 return len;
2255 } 2263 }
2264 #endif
2256 2265
2257 static int msn_send_im(struct gaim_connection *gc, char *who, char *message, int len, int flags) 2266 static int msn_send_im(struct gaim_connection *gc, char *who, char *message, int len, int flags)
2258 { 2267 {
2259 struct msn_data *md = gc->proto_data; 2268 struct msn_data *md = gc->proto_data;
2260 struct msn_switchboard *ms = msn_find_switch(gc, who); 2269 struct msn_switchboard *ms = msn_find_switch(gc, who);
2455 default: 2464 default:
2456 return _("Available"); 2465 return _("Available");
2457 } 2466 }
2458 } 2467 }
2459 2468
2469 #if 0
2460 static void msn_ask_send_file(struct gaim_connection *gc, char *destsn) 2470 static void msn_ask_send_file(struct gaim_connection *gc, char *destsn)
2461 { 2471 {
2462 struct msn_data *md = (struct msn_data *)gc->proto_data; 2472 struct msn_data *md = (struct msn_data *)gc->proto_data;
2463 struct msn_file_transfer *mft = g_new0(struct msn_file_transfer, 1); 2473 struct msn_file_transfer *mft = g_new0(struct msn_file_transfer, 1);
2464 2474
2468 2478
2469 md->file_transfers = g_slist_append(md->file_transfers, mft); 2479 md->file_transfers = g_slist_append(md->file_transfers, mft);
2470 2480
2471 mft->xfer = transfer_out_add(gc, mft->sn); 2481 mft->xfer = transfer_out_add(gc, mft->sn);
2472 } 2482 }
2483 #endif
2473 2484
2474 static GList *msn_buddy_menu(struct gaim_connection *gc, char *who) 2485 static GList *msn_buddy_menu(struct gaim_connection *gc, char *who)
2475 { 2486 {
2476 GList *m = NULL; 2487 GList *m = NULL;
2477 struct proto_buddy_menu *pbm; 2488 struct proto_buddy_menu *pbm;
2478 struct buddy *b = find_buddy(gc->account, who); 2489 struct buddy *b = find_buddy(gc->account, who);
2479 static char buf[MSN_BUF_LEN]; 2490 static char buf[MSN_BUF_LEN];
2480 2491
2492 #if 0
2481 pbm = g_new0(struct proto_buddy_menu, 1); 2493 pbm = g_new0(struct proto_buddy_menu, 1);
2482 pbm->label = _("Send File"); 2494 pbm->label = _("Send File");
2483 pbm->callback = msn_ask_send_file; 2495 pbm->callback = msn_ask_send_file;
2484 pbm->gc = gc; 2496 pbm->gc = gc;
2485 m = g_list_append(m, pbm); 2497 m = g_list_append(m, pbm);
2486 2498
2487 if (!b || !(b->uc >> 1)) 2499 if (!b || !(b->uc >> 1))
2488 return m; 2500 return m;
2501 #endif
2489 2502
2490 pbm = g_new0(struct proto_buddy_menu, 1); 2503 pbm = g_new0(struct proto_buddy_menu, 1);
2491 g_snprintf(buf, sizeof(buf), _("Status: %s"), msn_get_away_text(b->uc >> 1)); 2504 g_snprintf(buf, sizeof(buf), _("Status: %s"), msn_get_away_text(b->uc >> 1));
2492 pbm->label = buf; 2505 pbm->label = buf;
2493 pbm->callback = NULL; 2506 pbm->callback = NULL;
2852 ret->add_permit = msn_add_permit; 2865 ret->add_permit = msn_add_permit;
2853 ret->rem_permit = msn_rem_permit; 2866 ret->rem_permit = msn_rem_permit;
2854 ret->add_deny = msn_add_deny; 2867 ret->add_deny = msn_add_deny;
2855 ret->rem_deny = msn_rem_deny; 2868 ret->rem_deny = msn_rem_deny;
2856 ret->buddy_free = msn_buddy_free; 2869 ret->buddy_free = msn_buddy_free;
2870
2871 #if 0
2857 ret->file_transfer_cancel = msn_file_transfer_cancel; 2872 ret->file_transfer_cancel = msn_file_transfer_cancel;
2858 ret->file_transfer_in = msn_file_transfer_in; 2873 ret->file_transfer_in = msn_file_transfer_in;
2859 ret->file_transfer_out = msn_file_transfer_out; 2874 ret->file_transfer_out = msn_file_transfer_out;
2860 ret->file_transfer_done = msn_file_transfer_done; 2875 ret->file_transfer_done = msn_file_transfer_done;
2861 ret->file_transfer_read = msn_file_transfer_read; 2876 ret->file_transfer_read = msn_file_transfer_read;
2877 #endif
2862 2878
2863 puo = g_new0(struct proto_user_opt, 1); 2879 puo = g_new0(struct proto_user_opt, 1);
2864 puo->label = g_strdup(_("Server:")); 2880 puo->label = g_strdup(_("Server:"));
2865 puo->def = g_strdup(MSN_SERVER); 2881 puo->def = g_strdup(MSN_SERVER);
2866 puo->pos = USEROPT_MSNSERVER; 2882 puo->pos = USEROPT_MSNSERVER;