Mercurial > pidgin
changeset 7032:0ffd540660df
[gaim-migrate @ 7595]
-Made AIM over oscar show the away message in the second line of the big
blist. For the record, I'm against this because I think it's really ugly.
What are yous guys opinions?
-Changed the last g_show_info_text() in oscar.c to gaim_notify_formatted()
-Made oscar gaim_popup() use gaim_notify_formatted() instead
of serv_got_popup()
-Removed serv_got_popup(), des_popup(), and url_clicked_cb()
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 29 Sep 2003 22:34:32 +0000 |
parents | 8ecbba7d4118 |
children | cf1126ba1834 |
files | src/protocols/oscar/oscar.c src/server.c src/server.h |
diffstat | 3 files changed, 22 insertions(+), 74 deletions(-) [+] |
line wrap: on
line diff
--- a/src/protocols/oscar/oscar.c Mon Sep 29 22:31:29 2003 +0000 +++ b/src/protocols/oscar/oscar.c Mon Sep 29 22:34:32 2003 +0000 @@ -2871,7 +2871,7 @@ splitmsg = g_strsplit(msg, "\r\n", 0); dialog_msg = g_strdup_printf(_("<B>UIN:</B> %s<BR><B>Status:</B> %s<HR>%s"), who, status_msg, g_strjoinv("<BR>", splitmsg)); - g_show_info_text(gc, who, 2, dialog_msg, NULL); + gaim_notify_formatted(gc, NULL, _("Buddy Information"), NULL, dialog_msg, NULL, NULL); g_free(status_msg); g_free(dialog_msg); @@ -4008,9 +4008,11 @@ static int gaim_popup(aim_session_t *sess, aim_frame_t *fr, ...) { + GaimConnection *gc = sess->aux_data; + gchar *text; + va_list ap; char *msg, *url; fu16_t wid, hei, delay; - va_list ap; va_start(ap, fr); msg = va_arg(ap, char *); @@ -4020,12 +4022,15 @@ delay = (fu16_t) va_arg(ap, int); va_end(ap); - serv_got_popup(msg, url, wid, hei); + text = g_strdup_printf("%s<br><a href=\"%s\">%s</a>", msg, url, url); + gaim_notify_formatted(gc, NULL, _("Pop-Up Message"), NULL, text, NULL, NULL); + g_free(text); return 1; } -static int gaim_parse_searchreply(aim_session_t *sess, aim_frame_t *fr, ...) { +static int gaim_parse_searchreply(aim_session_t *sess, aim_frame_t *fr, ...) +{ GaimConnection *gc = sess->aux_data; gchar *secondary; GString *text; @@ -5440,8 +5445,18 @@ if ((b->uc & UC_UNAVAILABLE) || (((b->uc & 0xffff0000) >> 16) & AIM_ICQ_STATE_CHAT)) { if (isdigit(b->name[0])) ret = gaim_icq_status((b->uc & 0xffff0000) >> 16); - else - ret = g_strdup(_("Away")); + else { + aim_userinfo_t *userinfo = aim_locate_finduserinfo(b->name); + if ((userinfo != NULL) && (userinfo->flags & AIM_FLAG_AWAY) && (userinfo->away_len > 0) && (userinfo->away != NULL) && (userinfo->away_encoding != NULL)) { + gchar *away_utf8 = oscar_encoding_to_utf8(userinfo->away_encoding, userinfo->away, userinfo->away_len); + if (away_utf8 != NULL) { + ret = strip_html(away_utf8); + g_free(away_utf8); + } else + ret = g_strdup(_("Away")); + } else + ret = g_strdup(_("Away")); + } } else if (GAIM_BUDDY_IS_ONLINE(b)) { struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, normalize(b->name)); if (bi->availmsg) @@ -6246,7 +6261,7 @@ static void oscar_show_setavailmsg(GaimConnection *gc) { gaim_request_input(gc, NULL, _("Available Message:"), - NULL, _("Please talk to me, I'm lonely! (and single)"), TRUE, FALSE, + NULL, "Please talk to me, I'm lonely! (and single)", TRUE, FALSE, _("OK"), G_CALLBACK(oscar_setavailmsg), _("Cancel"), NULL, gc);
--- a/src/server.c Mon Sep 29 22:31:29 2003 +0000 +++ b/src/server.c Mon Sep 29 22:34:32 2003 +0000 @@ -1500,69 +1500,3 @@ g_free(buf); g_free(buffy); } - -static void des_popup(GtkWidget *w, GtkWidget *window) -{ - if (w == window) { - char *u = g_object_get_data(G_OBJECT(window), "url"); - g_free(u); - } - gtk_widget_destroy(window); -} - -static void -url_clicked_cb(GtkWidget *w, const char *uri) -{ - gaim_notify_uri(NULL, uri); -} - -void serv_got_popup(const char *msg, const char *u, int wid, int hei) -{ - GtkWidget *window; - GtkWidget *vbox; - GtkWidget *sw; - GtkWidget *text; - GtkWidget *hbox; - GtkWidget *button; - char *url = g_strdup(u); - - GAIM_DIALOG(window); - gtk_window_set_role(GTK_WINDOW(window), "popup"); - gtk_window_set_resizable(GTK_WINDOW(window), FALSE); - gtk_window_set_title(GTK_WINDOW(window), _("Gaim - Popup")); - gtk_container_set_border_width(GTK_CONTAINER(window), 5); - g_signal_connect(G_OBJECT(window), "destroy", - G_CALLBACK(des_popup), window); - g_object_set_data(G_OBJECT(window), "url", url); - gtk_widget_realize(window); - - vbox = gtk_vbox_new(FALSE, 5); - gtk_container_add(GTK_CONTAINER(window), vbox); - - sw = gtk_scrolled_window_new(NULL, NULL); - gtk_widget_set_size_request(sw, wid, hei); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); - gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 5); - - text = gtk_imhtml_new(NULL, NULL); - gtk_container_add(GTK_CONTAINER(sw), text); - gaim_setup_imhtml(text); - - hbox = gtk_hbox_new(FALSE, 5); - gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); - - button = gaim_pixbuf_button_from_stock(_("Close"), GTK_STOCK_CLOSE, GAIM_BUTTON_HORIZONTAL); - gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5); - g_signal_connect(G_OBJECT(button), "clicked", - G_CALLBACK(des_popup), window); - - button = gaim_pixbuf_button_from_stock(_("More Info"), GTK_STOCK_FIND, GAIM_BUTTON_HORIZONTAL); - gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5); - g_signal_connect(G_OBJECT(button), "clicked", - G_CALLBACK(url_clicked_cb), url); - - gtk_widget_show_all(window); - - gtk_imhtml_append_text(GTK_IMHTML(text), msg, GTK_IMHTML_NO_NEWLINE); -} -
--- a/src/server.h Mon Sep 29 22:31:29 2003 +0000 +++ b/src/server.h Mon Sep 29 22:34:32 2003 +0000 @@ -70,7 +70,6 @@ void serv_chat_leave(GaimConnection *, int); void serv_chat_whisper(GaimConnection *, int, const char *, const char *); int serv_chat_send(GaimConnection *, int, const char *); -void serv_got_popup(const char *, const char *, int, int); void serv_get_away(GaimConnection *, const char *); void serv_alias_buddy(GaimBuddy *); void serv_got_alias(GaimConnection *gc, const char *who, const char *alias);