comparison src/protocols/oscar/oscar.c @ 9973:09ed9a574761

[gaim-migrate @ 10884] Remove the old ICQ prpl committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 08 Sep 2004 03:11:41 +0000
parents 2c7c6bdb938b
children c66345b33b88
comparison
equal deleted inserted replaced
9972:2c7c6bdb938b 9973:09ed9a574761
294 static void oscar_direct_im_initiate(GaimConnection *gc, const char *who, const char *cookie); 294 static void oscar_direct_im_initiate(GaimConnection *gc, const char *who, const char *cookie);
295 295
296 /* remove these at some point? */ 296 /* remove these at some point? */
297 /* Because I don't like forward declarations? I think that was why... */ 297 /* Because I don't like forward declarations? I think that was why... */
298 static void oscar_set_info(GaimConnection *gc, const char *text); 298 static void oscar_set_info(GaimConnection *gc, const char *text);
299 static void oscar_set_away(GaimConnection *gc, const char *state, const char *message); 299 static void oscar_set_status(GaimConnection *gc, const char *state, const char *message);
300 300
301 static void recent_buddies_cb(const char *name, GaimPrefType type, gpointer value, gpointer data); 301 static void recent_buddies_cb(const char *name, GaimPrefType type, gpointer value, gpointer data);
302 302
303 static void oscar_free_name_data(struct name_data *data) { 303 static void oscar_free_name_data(struct name_data *data) {
304 g_free(data->name); 304 g_free(data->name);
677 return g_strdup_printf(_("Invisible")); 677 return g_strdup_printf(_("Invisible"));
678 else 678 else
679 return g_strdup_printf(_("Online")); 679 return g_strdup_printf(_("Online"));
680 } 680 }
681 681
682 static void oscar_string_append(GString *str, char *newline, char *name, char *value) 682 static void
683 oscar_string_append(GString *str, const char *newline, const char *name, const char *value)
683 { 684 {
684 gchar *utf8; 685 gchar *utf8;
685 686
686 if (value && value[0] && (utf8 = gaim_utf8_try_convert(value))) { 687 if (value && value[0] && (utf8 = gaim_utf8_try_convert(value))) {
687 g_string_append_printf(str, "%s<b>%s:</b> %s", newline, name, utf8); 688 g_string_append_printf(str, "%s<b>%s:</b> %s", newline, name, utf8);
688 g_free(utf8); 689 g_free(utf8);
689 } 690 }
690 } 691 }
691 692
692 static void oscar_string_append_info(GaimConnection *gc, GString *str, char *newline, GaimBuddy *b, aim_userinfo_t *userinfo) 693 static void oscar_string_append_info(GaimConnection *gc, GString *str, const char *newline, GaimBuddy *b, aim_userinfo_t *userinfo)
693 { 694 {
694 OscarData *od = gc->proto_data; 695 OscarData *od = gc->proto_data;
695 GaimAccount *account = gaim_connection_get_account(gc); 696 GaimAccount *account = gaim_connection_get_account(gc);
696 GaimGroup *g = NULL; 697 GaimGroup *g = NULL;
697 struct buddyinfo *bi = NULL; 698 struct buddyinfo *bi = NULL;
4987 { 4988 {
4988 return strftime(s, max, fmt, tm); 4989 return strftime(s, max, fmt, tm);
4989 } 4990 }
4990 #endif 4991 #endif
4991 4992
4992 static void oscar_string_append(GString *str, char *name, char *value)
4993 {
4994 gchar *utf8;
4995
4996 if (value && value[0] && (utf8 = gaim_utf8_try_convert(value))) {
4997 g_string_append_printf(str, "\n<br><b>%s:</b> %s", name, utf8);
4998 g_free(utf8);
4999 }
5000 }
5001
5002 static int gaim_icqinfo(aim_session_t *sess, aim_frame_t *fr, ...) 4993 static int gaim_icqinfo(aim_session_t *sess, aim_frame_t *fr, ...)
5003 { 4994 {
5004 GaimConnection *gc = sess->aux_data; 4995 GaimConnection *gc = sess->aux_data;
5005 OscarData *od = (OscarData *)gc->proto_data; 4996 OscarData *od = (OscarData *)gc->proto_data;
5006 GaimBuddy *buddy; 4997 GaimBuddy *buddy;
5530 g_free(text_html); 5521 g_free(text_html);
5531 5522
5532 return; 5523 return;
5533 } 5524 }
5534 5525
5535 static void oscar_set_away_aim(GaimConnection *gc, OscarData *od, const char *state, const char *text) 5526 static void oscar_set_status_aim(GaimConnection *gc, OscarData *od, const char *state, const char *text)
5536 { 5527 {
5537 int charset = 0; 5528 int charset = 0;
5538 gchar *text_html = NULL; 5529 gchar *text_html = NULL;
5539 char *msg = NULL; 5530 char *msg = NULL;
5540 gsize msglen = 0; 5531 gsize msglen = 0;
5610 g_free(text_html); 5601 g_free(text_html);
5611 5602
5612 return; 5603 return;
5613 } 5604 }
5614 5605
5615 static void oscar_set_away_icq(GaimConnection *gc, OscarData *od, const char *state, const char *message) 5606 static void oscar_set_status_icq(GaimConnection *gc, OscarData *od, const char *state, const char *message)
5616 { 5607 {
5617 GaimAccount *account = gaim_connection_get_account(gc); 5608 GaimAccount *account = gaim_connection_get_account(gc);
5618 if (gc->away) { 5609 if (gc->away) {
5619 g_free(gc->away); 5610 g_free(gc->away);
5620 gc->away = NULL; 5611 gc->away = NULL;
5657 } 5648 }
5658 5649
5659 return; 5650 return;
5660 } 5651 }
5661 5652
5662 static void oscar_set_away(GaimConnection *gc, const char *state, const char *message) 5653 static void oscar_set_status(GaimConnection *gc, const char *state, const char *message)
5663 { 5654 {
5664 OscarData *od = (OscarData *)gc->proto_data; 5655 OscarData *od = (OscarData *)gc->proto_data;
5665 5656
5666 if (od->icq) 5657 if (od->icq)
5667 oscar_set_away_icq(gc, od, state, message); 5658 oscar_set_status_icq(gc, od, state, message);
5668 else 5659 else
5669 oscar_set_away_aim(gc, od, state, message); 5660 oscar_set_status_aim(gc, od, state, message);
5670 5661
5671 return; 5662 return;
5672 } 5663 }
5673 5664
5674 static void oscar_warn(GaimConnection *gc, const char *name, gboolean anonymous) { 5665 static void oscar_warn(GaimConnection *gc, const char *name, gboolean anonymous) {
6081 if ((permdeny = aim_ssi_getpermdeny(sess->ssi.local)) && (permdeny != account->perm_deny)) { 6072 if ((permdeny = aim_ssi_getpermdeny(sess->ssi.local)) && (permdeny != account->perm_deny)) {
6082 gaim_debug_info("oscar", 6073 gaim_debug_info("oscar",
6083 "ssi: changing permdeny from %d to %hhu\n", account->perm_deny, permdeny); 6074 "ssi: changing permdeny from %d to %hhu\n", account->perm_deny, permdeny);
6084 account->perm_deny = permdeny; 6075 account->perm_deny = permdeny;
6085 if (od->icq && account->perm_deny == 0x03) { 6076 if (od->icq && account->perm_deny == 0x03) {
6086 serv_set_away(gc, "Invisible", ""); 6077 serv_set_status(gc, "Invisible", "");
6087 } 6078 }
6088 } 6079 }
6089 } 6080 }
6090 } break; 6081 } break;
6091 6082
6812 if (od->sess->ssi.received_data) 6803 if (od->sess->ssi.received_data)
6813 aim_ssi_deldeny(od->sess, who); 6804 aim_ssi_deldeny(od->sess, who);
6814 #endif 6805 #endif
6815 } 6806 }
6816 6807
6817 static GList *oscar_away_states(GaimConnection *gc) 6808 static GList *oscar_status_types(GaimAccount *account)
6818 { 6809 {
6819 OscarData *od = gc->proto_data; 6810 OscarData *od = gc->proto_data;
6820 GList *m = NULL; 6811 GList *m = NULL;
6812
6813 g_return_val_if_fail(account != NULL, NULL);
6821 6814
6822 if (od->icq) { 6815 if (od->icq) {
6823 m = g_list_append(m, _("Online")); 6816 m = g_list_append(m, _("Online"));
6824 m = g_list_append(m, _("Away")); 6817 m = g_list_append(m, _("Away"));
6825 m = g_list_append(m, _("Do Not Disturb")); 6818 m = g_list_append(m, _("Do Not Disturb"));
7349 {"jpeg,gif,bmp,ico", 48, 48, 50, 50, GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */ 7342 {"jpeg,gif,bmp,ico", 48, 48, 50, 50, GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */
7350 oscar_list_icon, /* list_icon */ 7343 oscar_list_icon, /* list_icon */
7351 oscar_list_emblems, /* list_emblems */ 7344 oscar_list_emblems, /* list_emblems */
7352 oscar_status_text, /* status_text */ 7345 oscar_status_text, /* status_text */
7353 oscar_tooltip_text, /* tooltip_text */ 7346 oscar_tooltip_text, /* tooltip_text */
7354 oscar_away_states, /* away_states */ 7347 oscar_status_types, /* status_types */
7355 oscar_blist_node_menu, /* blist_node_menu */ 7348 oscar_blist_node_menu, /* blist_node_menu */
7356 oscar_chat_info, /* chat_info */ 7349 oscar_chat_info, /* chat_info */
7357 oscar_chat_info_defaults, /* chat_info_defaults */ 7350 oscar_chat_info_defaults, /* chat_info_defaults */
7358 oscar_login, /* login */ 7351 oscar_login, /* login */
7359 oscar_close, /* close */ 7352 oscar_close, /* close */
7360 oscar_send_im, /* send_im */ 7353 oscar_send_im, /* send_im */
7361 oscar_set_info, /* set_info */ 7354 oscar_set_info, /* set_info */
7362 oscar_send_typing, /* send_typing */ 7355 oscar_send_typing, /* send_typing */
7363 oscar_get_info, /* get_info */ 7356 oscar_get_info, /* get_info */
7364 oscar_set_away, /* set_away */ 7357 oscar_set_status, /* set_status */
7365 oscar_set_idle, /* set_idle */ 7358 oscar_set_idle, /* set_idle */
7366 oscar_change_passwd, /* change_passwd */ 7359 oscar_change_passwd, /* change_passwd */
7367 oscar_add_buddy, /* add_buddy */ 7360 oscar_add_buddy, /* add_buddy */
7368 oscar_add_buddies, /* add_buddies */ 7361 oscar_add_buddies, /* add_buddies */
7369 oscar_remove_buddy, /* remove_buddy */ 7362 oscar_remove_buddy, /* remove_buddy */
7374 oscar_rem_deny, /* rem_deny */ 7367 oscar_rem_deny, /* rem_deny */
7375 oscar_set_permit_deny, /* set_permit_deny */ 7368 oscar_set_permit_deny, /* set_permit_deny */
7376 oscar_warn, /* warn */ 7369 oscar_warn, /* warn */
7377 oscar_join_chat, /* join_chat */ 7370 oscar_join_chat, /* join_chat */
7378 NULL, /* reject_chat */ 7371 NULL, /* reject_chat */
7379 oscar_get_chat_name, /* get_chat_name */ 7372 oscar_get_chat_name, /* get_chat_name */
7380 oscar_chat_invite, /* chat_invite */ 7373 oscar_chat_invite, /* chat_invite */
7381 oscar_chat_leave, /* chat_leave */ 7374 oscar_chat_leave, /* chat_leave */
7382 NULL, /* chat_whisper */ 7375 NULL, /* chat_whisper */
7383 oscar_send_chat, /* chat_send */ 7376 oscar_send_chat, /* chat_send */
7384 oscar_keepalive, /* keepalive */ 7377 oscar_keepalive, /* keepalive */