comparison libpurple/protocols/yahoo/libymsg.c @ 28439:e61b10db0044

This will fix adding, removing MSN contacts on yahoo's deny list
author Sulabh Mahajan <sulabh@soc.pidgin.im>
date Mon, 24 Aug 2009 22:27:18 +0000
parents 0400ef272c46
children 336d03cdced6 b8b90d4cf2f5 b641af9dfe2a
comparison
equal deleted inserted replaced
28438:80265d67fc7e 28439:e61b10db0044
4772 } 4772 }
4773 4773
4774 void yahoo_add_deny(PurpleConnection *gc, const char *who) { 4774 void yahoo_add_deny(PurpleConnection *gc, const char *who) {
4775 YahooData *yd = (YahooData *)gc->proto_data; 4775 YahooData *yd = (YahooData *)gc->proto_data;
4776 struct yahoo_packet *pkt; 4776 struct yahoo_packet *pkt;
4777 gboolean msn = FALSE;
4777 4778
4778 if (!yd->logged_in) 4779 if (!yd->logged_in)
4779 return; 4780 return;
4780 4781
4781 if (!who || who[0] == '\0') 4782 if (!who || who[0] == '\0')
4782 return; 4783 return;
4783 4784
4785 msn = !g_ascii_strncasecmp(who, "msn/", 4);
4784 pkt = yahoo_packet_new(YAHOO_SERVICE_IGNORECONTACT, YAHOO_STATUS_AVAILABLE, yd->session_id); 4786 pkt = yahoo_packet_new(YAHOO_SERVICE_IGNORECONTACT, YAHOO_STATUS_AVAILABLE, yd->session_id);
4785 yahoo_packet_hash(pkt, "sss", 1, purple_connection_get_display_name(gc), 4787
4786 7, who, 13, "1"); 4788 if(msn)
4789 yahoo_packet_hash(pkt, "ssss", 1, purple_connection_get_display_name(gc), 7, who+4, 241, "2", 13, "1");
4790 else
4791 yahoo_packet_hash(pkt, "sss", 1, purple_connection_get_display_name(gc), 7, who, 13, "1");
4792
4787 yahoo_packet_send_and_free(pkt, yd); 4793 yahoo_packet_send_and_free(pkt, yd);
4788 } 4794 }
4789 4795
4790 void yahoo_rem_deny(PurpleConnection *gc, const char *who) { 4796 void yahoo_rem_deny(PurpleConnection *gc, const char *who) {
4791 YahooData *yd = (YahooData *)gc->proto_data; 4797 YahooData *yd = (YahooData *)gc->proto_data;
4792 struct yahoo_packet *pkt; 4798 struct yahoo_packet *pkt;
4799 gboolean msn = FALSE;
4793 4800
4794 if (!yd->logged_in) 4801 if (!yd->logged_in)
4795 return; 4802 return;
4796 4803
4797 if (!who || who[0] == '\0') 4804 if (!who || who[0] == '\0')
4798 return; 4805 return;
4799 4806
4807 msn = !g_ascii_strncasecmp(who, "msn/", 4);
4800 pkt = yahoo_packet_new(YAHOO_SERVICE_IGNORECONTACT, YAHOO_STATUS_AVAILABLE, yd->session_id); 4808 pkt = yahoo_packet_new(YAHOO_SERVICE_IGNORECONTACT, YAHOO_STATUS_AVAILABLE, yd->session_id);
4801 yahoo_packet_hash(pkt, "sss", 1, purple_connection_get_display_name(gc), 7, who, 13, "2"); 4809
4810 if(msn)
4811 yahoo_packet_hash(pkt, "ssss", 1, purple_connection_get_display_name(gc), 7, who+4, 241, "2", 13, "2");
4812 else
4813 yahoo_packet_hash(pkt, "sss", 1, purple_connection_get_display_name(gc), 7, who, 13, "2");
4814
4802 yahoo_packet_send_and_free(pkt, yd); 4815 yahoo_packet_send_and_free(pkt, yd);
4803 } 4816 }
4804 4817
4805 void yahoo_set_permit_deny(PurpleConnection *gc) 4818 void yahoo_set_permit_deny(PurpleConnection *gc)
4806 { 4819 {