Mercurial > pidgin
comparison plugins/msn/msn.c @ 1275:de3339e2a0c4
[gaim-migrate @ 1285]
Signing off w/ the MSN plugin should work now. It also ignores messages from teh Hotmail server :-D
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Thu, 14 Dec 2000 18:54:40 +0000 |
parents | b0bd82cce5e1 |
children | 3e19d163fc45 |
comparison
equal
deleted
inserted
replaced
1274:32e819c194fd | 1275:de3339e2a0c4 |
---|---|
365 gchar *message; | 365 gchar *message; |
366 gchar *buf2; | 366 gchar *buf2; |
367 int size; | 367 int size; |
368 int status; | 368 int status; |
369 | 369 |
370 if (strcasecmp("hotmail", resps[1]) == 0) { | |
371 /* We want to ignore these */ | |
372 g_strfreev(resps); | |
373 return; | |
374 } | |
375 | |
370 /* Determine our message size */ | 376 /* Determine our message size */ |
371 size = atoi(resps[3]); | 377 size = atoi(resps[3]); |
372 | 378 |
373 buf2 = (gchar *)g_malloc(sizeof(gchar) * (size+1)); | 379 buf2 = (gchar *)g_malloc(sizeof(gchar) * (size+1)); |
374 status = recv(fd, buf2, size, 0); | 380 status = recv(fd, buf2, size, 0); |
678 g_snprintf(buf, strlen(message) + strlen(MIME_HEADER) + 64, "MSG %d N %d\r\n%s%s", trId, strlen(message)+strlen(MIME_HEADER), MIME_HEADER, message); | 684 g_snprintf(buf, strlen(message) + strlen(MIME_HEADER) + 64, "MSG %d N %d\r\n%s%s", trId, strlen(message)+strlen(MIME_HEADER), MIME_HEADER, message); |
679 | 685 |
680 write(mc->fd, buf, strlen(buf)); | 686 write(mc->fd, buf, strlen(buf)); |
681 | 687 |
682 g_free(buf); | 688 g_free(buf); |
689 } | |
690 | |
691 void msn_close (struct gaim_connection *gc) { | |
692 struct msn_data *mdata = (struct msn_data *)gc->proto_data; | |
693 GSList *conns = msn_connections; | |
694 struct msn_conn *mc = NULL; | |
695 char buf[4096]; | |
696 | |
697 while (conns) { | |
698 mc = (struct msn_conn *)conns->data; | |
699 | |
700 if (mc->inpa > 0) | |
701 gdk_input_remove(mc->inpa); | |
702 | |
703 if (mc->fd > 0) | |
704 close(mc->fd); | |
705 | |
706 if (mc->user != NULL) | |
707 g_free(mc->user); | |
708 | |
709 conns = g_slist_remove(conns, mc); | |
710 g_free(mc); | |
711 } | |
712 | |
713 | |
714 g_snprintf(buf, 4096, "OUT\n"); | |
715 write(mdata->fd, buf, strlen(buf)); | |
716 | |
717 if (gc->inpa > 0) | |
718 gdk_input_remove(gc->inpa); | |
719 | |
720 close(mdata->fd); | |
721 | |
722 if (mdata->friendly != NULL) | |
723 g_free(mdata->friendly); | |
724 | |
725 g_free(gc->proto_data); | |
726 | |
727 debug_printf(_("Signed off.\n")); | |
728 | |
683 } | 729 } |
684 | 730 |
685 static struct prpl *my_protocol = NULL; | 731 static struct prpl *my_protocol = NULL; |
686 | 732 |
687 void msn_init(struct prpl *ret) { | 733 void msn_init(struct prpl *ret) { |
689 ret->name = msn_name; | 735 ret->name = msn_name; |
690 ret->list_icon = NULL; | 736 ret->list_icon = NULL; |
691 ret->action_menu = NULL; | 737 ret->action_menu = NULL; |
692 ret->user_opts = NULL; | 738 ret->user_opts = NULL; |
693 ret->login = msn_login; | 739 ret->login = msn_login; |
694 ret->close = NULL; | 740 ret->close = msn_close; |
695 ret->send_im = msn_send_im; | 741 ret->send_im = msn_send_im; |
696 ret->set_info = NULL; | 742 ret->set_info = NULL; |
697 ret->get_info = NULL; | 743 ret->get_info = NULL; |
698 ret->set_away = NULL; | 744 ret->set_away = NULL; |
699 ret->get_away_msg = NULL; | 745 ret->get_away_msg = NULL; |