comparison src/protocols/oscar/oscar.c @ 12271:3c6675e1400e

[gaim-migrate @ 14573] Don't show the available message twice in oscar tooltips committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 30 Nov 2005 06:02:38 +0000
parents 0a9574ed62cd
children 1baf4cbcf84d
comparison
equal deleted inserted replaced
12270:a2bbde197826 12271:3c6675e1400e
801 char *tmp2 = g_markup_escape_text(tmp, strlen(tmp)); 801 char *tmp2 = g_markup_escape_text(tmp, strlen(tmp));
802 g_free(tmp); 802 g_free(tmp);
803 oscar_string_append(str, newline, _("Buddy Comment"), tmp2); 803 oscar_string_append(str, newline, _("Buddy Comment"), tmp2);
804 g_free(tmp2); 804 g_free(tmp2);
805 } 805 }
806 }
807
808 if ((bi != NULL) && (bi->availmsg != NULL) && gaim_status_is_available(status)) {
809 tmp = g_markup_escape_text(bi->availmsg, strlen(bi->availmsg));
810 oscar_string_append(str, newline, _("Available"), tmp);
811 g_free(tmp);
812 } 806 }
813 } 807 }
814 808
815 static char *extract_name(const char *name) { 809 static char *extract_name(const char *name) {
816 char *tmp, *x; 810 char *tmp, *x;
5067 g_free(tmp); 5061 g_free(tmp);
5068 } 5062 }
5069 5063
5070 oscar_string_append_info(gc, str, "\n<br>", NULL, userinfo); 5064 oscar_string_append_info(gc, str, "\n<br>", NULL, userinfo);
5071 5065
5066 /*
5067 * TODO: Need to duplicate what oscar_tooltip_text() does here so that
5068 * we show the available message in the buddy info.
5069 */
5070
5072 if ((userinfo->flags & AIM_FLAG_AWAY) && (userinfo->away_len > 0) && (userinfo->away != NULL) && (userinfo->away_encoding != NULL)) { 5071 if ((userinfo->flags & AIM_FLAG_AWAY) && (userinfo->away_len > 0) && (userinfo->away != NULL) && (userinfo->away_encoding != NULL)) {
5073 tmp = oscar_encoding_extract(userinfo->away_encoding); 5072 tmp = oscar_encoding_extract(userinfo->away_encoding);
5074 away_utf8 = oscar_encoding_to_utf8(tmp, userinfo->away, userinfo->away_len); 5073 away_utf8 = oscar_encoding_to_utf8(tmp, userinfo->away, userinfo->away_len);
5075 g_free(tmp); 5074 g_free(tmp);
5076 if (away_utf8 != NULL) { 5075 if (away_utf8 != NULL) {
5119 return 1; 5118 return 1;
5120 5119
5121 presence = gaim_buddy_get_presence(b); 5120 presence = gaim_buddy_get_presence(b);
5122 active_status = gaim_presence_get_active_status(presence); 5121 active_status = gaim_presence_get_active_status(presence);
5123 5122
5124 if (gaim_status_type_get_primitive(gaim_status_get_type(active_status)) == GAIM_STATUS_AVAILABLE) { 5123 if (gaim_status_is_available(active_status))
5124 {
5125 struct buddyinfo *bi; 5125 struct buddyinfo *bi;
5126 5126
5127 bi = g_hash_table_lookup(od->buddyinfo, gaim_normalize(b->account, b->name)); 5127 bi = g_hash_table_lookup(od->buddyinfo, gaim_normalize(b->account, b->name));
5128 if ((bi != NULL) && (bi->availmsg != NULL)) 5128 if ((bi != NULL) && (bi->availmsg != NULL))
5129 message = g_markup_escape_text(bi->availmsg, strlen(bi->availmsg)); 5129 message = g_markup_escape_text(bi->availmsg, strlen(bi->availmsg));
7598 message = gaim_status_get_attr_string(status, "message"); 7598 message = gaim_status_get_attr_string(status, "message");
7599 7599
7600 if (message != NULL) { 7600 if (message != NULL) {
7601 if (gaim_status_type_get_primitive(gaim_status_get_type(status)) == GAIM_STATUS_AVAILABLE) { 7601 if (gaim_status_type_get_primitive(gaim_status_get_type(status)) == GAIM_STATUS_AVAILABLE) {
7602 /* Available status messages are plain text */ 7602 /* Available status messages are plain text */
7603 g_string_append_printf(str, "\n<b>%s:</b> %s", _("Status Message"), message); 7603 g_string_append_printf(str, "\n<b>%s:</b> %s", _("Available Message"), message);
7604 } else { 7604 } else {
7605 /* Away messages are HTML */ 7605 /* Away messages are HTML */
7606 gchar *tmp1, *tmp2; 7606 gchar *tmp1, *tmp2;
7607 tmp2 = gaim_markup_strip_html(message); 7607 tmp2 = gaim_markup_strip_html(message);
7608 tmp1 = g_markup_escape_text(tmp2, -1); 7608 tmp1 = g_markup_escape_text(tmp2, -1);