Mercurial > pidgin
comparison src/protocols/msn/msn.c @ 10345:2e01c503aa4f
[gaim-migrate @ 11556]
Patch 1078151 from Felipe Contreras to fix some more MSN bugs:
"User Dislpay messages, and other less used, did not set
an slpcall, so the callback that should not be called,
was called (in some very special cases)."
...
"Here it goes the real real one, as far as I can tell.
Cleaning + organizing + documentation + hard bug fix = big
patch." -- Felipe Contreras
I also fixed drag-and-drop to conversation window file transfers (which
I had broken when I fixed some other dnd thing), made the debug output
of the autoreconnect plugin more useful, and stopped the message
notification plugin notifying you for messages sent by ignored users.
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Sat, 11 Dec 2004 20:01:58 +0000 |
parents | 56cc5d49472b |
children | bbf738a0ce7b |
comparison
equal
deleted
inserted
replaced
10344:5976491e07a7 | 10345:2e01c503aa4f |
---|---|
755 MsnSwitchBoard *swboard; | 755 MsnSwitchBoard *swboard; |
756 | 756 |
757 session = gc->proto_data; | 757 session = gc->proto_data; |
758 swboard = msn_session_get_swboard(session, who); | 758 swboard = msn_session_get_swboard(session, who); |
759 | 759 |
760 | 760 if (!g_queue_is_empty(swboard->im_queue) || swboard->empty) |
761 if (!g_queue_is_empty(swboard->im_queue) || | |
762 !swboard->user_joined) | |
763 { | 761 { |
764 msn_switchboard_queue_msg(swboard, msg); | 762 msn_switchboard_queue_msg(swboard, msg); |
765 } | 763 } |
766 else | 764 else |
767 { | 765 { |
768 msn_switchboard_send_msg(swboard, msg); | 766 msn_switchboard_send_msg(swboard, msg); |
769 } | 767 } |
770 | |
771 } | 768 } |
772 else | 769 else |
773 { | 770 { |
774 char *body_str, *body_enc, *pre, *post; | 771 char *body_str, *body_enc, *pre, *post; |
775 const char *format; | 772 const char *format; |
822 swboard = msn_session_find_swboard(session, who); | 819 swboard = msn_session_find_swboard(session, who); |
823 | 820 |
824 if (swboard == NULL) | 821 if (swboard == NULL) |
825 return 0; | 822 return 0; |
826 | 823 |
827 if (!swboard->user_joined) | 824 if (swboard->empty) |
828 return 0; | 825 return 0; |
829 | 826 |
830 msg = msn_message_new(MSN_MSG_TYPING); | 827 msg = msn_message_new(MSN_MSG_TYPING); |
831 msn_message_set_content_type(msg, "text/x-msmsgscontrol"); | 828 msn_message_set_content_type(msg, "text/x-msmsgscontrol"); |
832 msn_message_set_flag(msg, 'U'); | 829 msn_message_set_flag(msg, 'U'); |
833 msn_message_set_attr(msg, "TypingUser", | 830 msn_message_set_attr(msg, "TypingUser", |
834 gaim_account_get_username(account)); | 831 gaim_account_get_username(account)); |
835 msn_message_set_bin_data(msg, "\r\n", 2); | 832 msn_message_set_bin_data(msg, "\r\n", 2); |
836 | 833 |
837 msn_switchboard_send_msg(swboard, msg); | 834 swboard = msn_session_get_swboard(session, who); |
835 | |
836 if (!g_queue_is_empty(swboard->im_queue) || swboard->empty) | |
837 { | |
838 msn_switchboard_queue_msg(swboard, msg); | |
839 } | |
840 else | |
841 { | |
842 msn_switchboard_send_msg(swboard, msg); | |
843 } | |
838 | 844 |
839 msn_message_destroy(msg); | 845 msn_message_destroy(msg); |
840 | 846 |
841 return MSN_TYPING_SEND_TIMEOUT; | 847 return MSN_TYPING_SEND_TIMEOUT; |
842 } | 848 } |
1153 swboard = msn_session_find_switch_with_id(session, id); | 1159 swboard = msn_session_find_switch_with_id(session, id); |
1154 | 1160 |
1155 if (swboard == NULL) | 1161 if (swboard == NULL) |
1156 return -EINVAL; | 1162 return -EINVAL; |
1157 | 1163 |
1158 if (swboard->ready) | 1164 if (!swboard->ready) |
1159 { | 1165 return 0; |
1160 msn_import_html(message, &msgformat, &msgtext); | 1166 |
1161 | 1167 msn_import_html(message, &msgformat, &msgtext); |
1162 if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564) | 1168 |
1163 { | 1169 if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564) |
1164 g_free(msgformat); | 1170 { |
1165 g_free(msgtext); | |
1166 | |
1167 return -E2BIG; | |
1168 } | |
1169 | |
1170 msg = msn_message_new_plain(msgtext); | |
1171 msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat); | |
1172 msn_switchboard_send_msg(swboard, msg); | |
1173 msn_message_destroy(msg); | |
1174 | |
1175 g_free(msgformat); | 1171 g_free(msgformat); |
1176 g_free(msgtext); | 1172 g_free(msgtext); |
1177 | 1173 |
1178 serv_got_chat_in(gc, id, gaim_account_get_username(account), 0, | 1174 return -E2BIG; |
1179 message, time(NULL)); | 1175 } |
1180 } | 1176 |
1177 msg = msn_message_new_plain(msgtext); | |
1178 msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat); | |
1179 msn_switchboard_send_msg(swboard, msg); | |
1180 msn_message_destroy(msg); | |
1181 | |
1182 g_free(msgformat); | |
1183 g_free(msgtext); | |
1184 | |
1185 serv_got_chat_in(gc, id, gaim_account_get_username(account), 0, | |
1186 message, time(NULL)); | |
1181 | 1187 |
1182 return 0; | 1188 return 0; |
1183 } | 1189 } |
1184 | 1190 |
1185 static void | 1191 static void |