comparison libpurple/protocols/oscar/oscar.c @ 29460:a0fb6798d87c

Made it compile again. Changed aim_info.flag to guint64, to avoid loss of precition, I hope this won't break it... Re-introduced a couple of UI callbacks lost in earlier merges
author Marcus Lundblad <ml@update.uu.se>
date Sun, 07 Feb 2010 21:11:56 +0000
parents a538cb73f897
children c9866e46f629
comparison
equal deleted inserted replaced
29459:c3b735f8f490 29460:a0fb6798d87c
230 static void purple_icons_fetch(PurpleConnection *gc); 230 static void purple_icons_fetch(PurpleConnection *gc);
231 231
232 void oscar_set_info(PurpleConnection *gc, const char *info); 232 void oscar_set_info(PurpleConnection *gc, const char *info);
233 static void oscar_set_info_and_status(PurpleAccount *account, gboolean setinfo, const char *rawinfo, gboolean setstatus, PurpleStatus *status); 233 static void oscar_set_info_and_status(PurpleAccount *account, gboolean setinfo, const char *rawinfo, gboolean setstatus, PurpleStatus *status);
234 static void oscar_set_extendedstatus(PurpleConnection *gc); 234 static void oscar_set_extendedstatus(PurpleConnection *gc);
235 static void oscar_format_username(PurpleConnection *gc, const char *nick);
236 static gboolean purple_ssi_rerequestdata(gpointer data); 235 static gboolean purple_ssi_rerequestdata(gpointer data);
237 236
238 static void oscar_free_name_data(struct name_data *data) { 237 static void oscar_free_name_data(struct name_data *data) {
239 g_free(data->name); 238 g_free(data->name);
240 g_free(data->nick); 239 g_free(data->nick);
678 677
679 static gchar *oscar_caps_to_string(OscarCapability caps) 678 static gchar *oscar_caps_to_string(OscarCapability caps)
680 { 679 {
681 GString *str; 680 GString *str;
682 const gchar *tmp; 681 const gchar *tmp;
683 guint bit = 1; 682 guint64 bit = 1;
684 683
685 str = g_string_new(""); 684 str = g_string_new("");
686 685
687 if (!caps) { 686 if (!caps) {
688 return NULL; 687 return NULL;
799 else if (state & AIM_ICQ_STATE_EVIL) 798 else if (state & AIM_ICQ_STATE_EVIL)
800 return g_strdup(_("Evil")); 799 return g_strdup(_("Evil"));
801 else if (state & AIM_ICQ_STATE_DEPRESSION) 800 else if (state & AIM_ICQ_STATE_DEPRESSION)
802 return g_strdup(_("Depression")); 801 return g_strdup(_("Depression"));
803 else if (state & AIM_ICQ_STATE_ATHOME) 802 else if (state & AIM_ICQ_STATE_ATHOME)
804 return g_strdup_(_("At home")); 803 return g_strdup(_("At home"));
805 else if (state & AIM_ICQ_STATE_ATWORK) 804 else if (state & AIM_ICQ_STATE_ATWORK)
806 return g_strdup(_("At work")); 805 return g_strdup(_("At work"));
807 else if (state & AIM_ICQ_STATE_LUNCH) 806 else if (state & AIM_ICQ_STATE_LUNCH)
808 return g_strdup(_("At lunch")); 807 return g_strdup(_("At lunch"));
809 else 808 else
2728 purple_debug_info("oscar", "Got an ICQ Server Relay message of " 2727 purple_debug_info("oscar", "Got an ICQ Server Relay message of "
2729 "type %d\n", args->info.rtfmsg.msgtype); 2728 "type %d\n", args->info.rtfmsg.msgtype);
2730 purple_debug_info("oscar", "Sending X-Status Reply\n"); 2729 purple_debug_info("oscar", "Sending X-Status Reply\n");
2731 2730
2732 if(args->info.rtfmsg.msgtype == 26) 2731 if(args->info.rtfmsg.msgtype == 26)
2733 icq_relay_xstatus(od, userinfo->sn, args->cookie); 2732 icq_relay_xstatus(od, userinfo->bn, args->cookie);
2734 2733
2735 if(args->info.rtfmsg.msgtype == 1) 2734 if(args->info.rtfmsg.msgtype == 1)
2736 { 2735 {
2737 if(rtfmsg) 2736 if(rtfmsg)
2738 { 2737 {
2739 serv_got_im(gc, userinfo->sn, rtfmsg, flags, 2738 serv_got_im(gc, userinfo->bn, rtfmsg, flags,
2740 time(NULL)); 2739 time(NULL));
2741 } 2740 }
2742 else 2741 else
2743 { 2742 {
2744 serv_got_im(gc, userinfo->sn, 2743 serv_got_im(gc, userinfo->bn,
2745 args->info.rtfmsg.rtfmsg, flags, 2744 args->info.rtfmsg.rtfmsg, flags,
2746 time(NULL)); 2745 time(NULL));
2747 } 2746 }
2748 } 2747 }
2749 } 2748 }
5162 return; 5161 return;
5163 5162
5164 if (!purple_account_is_connected(account)) 5163 if (!purple_account_is_connected(account))
5165 return; 5164 return;
5166 5165
5166 pc = purple_account_get_connection(account);
5167 od = purple_connection_get_protocol_data(pc);
5168
5167 /* There's no need to do the stuff below for mood updates. */ 5169 /* There's no need to do the stuff below for mood updates. */
5168 if (purple_status_type_get_primitive(purple_status_get_type(status)) == PURPLE_STATUS_MOOD) { 5170 if (purple_status_type_get_primitive(purple_status_get_type(status)) == PURPLE_STATUS_MOOD) {
5169 PurpleConnection *gc = purple_account_get_connection(account); 5171 aim_locate_setcaps(od, purple_caps);
5170 aim_locate_setcaps((OscarData *)gc->proto_data, purple_caps);
5171 return; 5172 return;
5172 } 5173 }
5173 5174
5174 /* Set the AIM-style away message for both AIM and ICQ accounts */ 5175 /* Set the AIM-style away message for both AIM and ICQ accounts */
5175 oscar_set_info_and_status(account, FALSE, NULL, TRUE, status); 5176 oscar_set_info_and_status(account, FALSE, NULL, TRUE, status);
6721 purple_debug_info("oscar", "Manual X-Status Get From %s to %s:\n", purple_buddy_get_name(buddy), account->username); 6722 purple_debug_info("oscar", "Manual X-Status Get From %s to %s:\n", purple_buddy_get_name(buddy), account->username);
6722 6723
6723 icq_im_xstatus_request(gc->proto_data, purple_buddy_get_name(buddy)); 6724 icq_im_xstatus_request(gc->proto_data, purple_buddy_get_name(buddy));
6724 } 6725 }
6725 6726
6727 static void
6728 oscar_get_aim_info_cb(PurpleBlistNode *node, gpointer ignore)
6729 {
6730 PurpleBuddy *buddy;
6731 PurpleConnection *gc;
6732
6733 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
6734
6735 buddy = (PurpleBuddy *)node;
6736 gc = purple_account_get_connection(purple_buddy_get_account(buddy));
6737
6738 aim_locate_getinfoshort(purple_connection_get_protocol_data(gc),
6739 purple_buddy_get_name(buddy), 0x00000003);
6740 }
6741
6726 static GList * 6742 static GList *
6727 oscar_buddy_menu(PurpleBuddy *buddy) { 6743 oscar_buddy_menu(PurpleBuddy *buddy) {
6728 6744
6729 PurpleConnection *gc; 6745 PurpleConnection *gc;
6730 OscarData *od; 6746 OscarData *od;