comparison pidgin/gtkutils.c @ 18218:571e0ca28d6c

Show immediate feedback when getting information about someone in a chat. Fixes #387.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 21 Jun 2007 06:46:27 +0000
parents 16bf31872b7a
children 44928d01ec8c d28015a513a9
comparison
equal deleted inserted replaced
18217:e3a4ed0febd2 18218:571e0ca28d6c
911 "accels", NULL); 911 "accels", NULL);
912 gtk_accel_map_load(filename); 912 gtk_accel_map_load(filename);
913 g_free(filename); 913 g_free(filename);
914 } 914 }
915 915
916 void pidgin_retrieve_user_info(PurpleConnection *conn, const char *name) 916 static void
917 show_retrieveing_info(PurpleConnection *conn, const char *name)
917 { 918 {
918 PurpleNotifyUserInfo *info = purple_notify_user_info_new(); 919 PurpleNotifyUserInfo *info = purple_notify_user_info_new();
919 purple_notify_user_info_add_pair(info, _("Information"), _("Retrieving...")); 920 purple_notify_user_info_add_pair(info, _("Information"), _("Retrieving..."));
920 purple_notify_userinfo(conn, name, info, NULL, NULL); 921 purple_notify_userinfo(conn, name, info, NULL, NULL);
921 purple_notify_user_info_destroy(info); 922 purple_notify_user_info_destroy(info);
923 }
924
925 void pidgin_retrieve_user_info(PurpleConnection *conn, const char *name)
926 {
927 show_retrieveing_info(conn, name);
922 serv_get_info(conn, name); 928 serv_get_info(conn, name);
929 }
930
931 void pidgin_retrieve_user_info_in_chat(PurpleConnection *conn, const char *name, int chat)
932 {
933 char *who = NULL;
934 PurplePluginProtocolInfo *prpl_info = NULL;
935
936 if (chat < 0) {
937 pidgin_retrieve_user_info(conn, name);
938 return;
939 }
940
941 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(conn->prpl);
942 if (prpl_info == NULL || prpl_info->get_cb_info == NULL) {
943 pidgin_retrieve_user_info(conn, name);
944 return;
945 }
946
947 if (prpl_info->get_cb_real_name)
948 who = prpl_info->get_cb_real_name(conn, chat, name);
949 show_retrieveing_info(conn, who ? who : name);
950 prpl_info->get_cb_info(conn, chat, name);
951 g_free(who);
923 } 952 }
924 953
925 gboolean 954 gboolean
926 pidgin_parse_x_im_contact(const char *msg, gboolean all_accounts, 955 pidgin_parse_x_im_contact(const char *msg, gboolean all_accounts,
927 PurpleAccount **ret_account, char **ret_protocol, 956 PurpleAccount **ret_account, char **ret_protocol,