pidgin: ec280cac: Patch to properly publish status message...
rekkanoryo at pidgin.im
rekkanoryo at pidgin.im
Tue Feb 3 20:45:38 EST 2009
-----------------------------------------------------------------
Revision: ec280cacde2b66789afcb95d135aee359722d471
Ancestor: 5d95cd6977838f9a8cf0f574d0e8f6f09e2d9fca
Author: dimmuxx at yahoo.se
Date: 2009-02-04T01:30:35
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/ec280cacde2b66789afcb95d135aee359722d471
Modified files:
libpurple/protocols/oscar/oscar.c
ChangeLog:
Patch to properly publish status messages for statuses other than Available.
Fixes #582.
-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/oscar.c bef765c91c916ce9547cb1f0fb6245cb39c4f713
+++ libpurple/protocols/oscar/oscar.c 23643a831ac37e40ab89982801b9268220545660
@@ -4782,7 +4782,7 @@ oscar_set_info_and_status(PurpleAccount
if (status_html != NULL)
{
status_text = purple_markup_strip_html(status_html);
- /* If the status_text is longer than 60 character then truncate it */
+ /* If the status_text is longer than 251 characters then truncate it */
if (strlen(status_text) > MAXAVAILMSGLEN)
{
char *tmp = g_utf8_find_prev_char(status_text, &status_text[MAXAVAILMSGLEN - 2]);
@@ -4799,9 +4799,28 @@ oscar_set_info_and_status(PurpleAccount
}
else
{
+ char *status_text = NULL;
+
htmlaway = purple_status_get_attr_string(status, "message");
if ((htmlaway == NULL) || (*htmlaway == '\0'))
htmlaway = purple_status_type_get_name(status_type);
+
+ /* ICQ 6.x seems to use an available message for all statuses so set one */
+ if (od->icq)
+ {
+ status_text = purple_markup_strip_html(htmlaway);
+ /* If the status_text is longer than 251 characters then truncate it */
+ if (strlen(status_text) > MAXAVAILMSGLEN)
+ {
+ char *tmp = g_utf8_find_prev_char(status_text, &status_text[MAXAVAILMSGLEN - 2]);
+ strcpy(tmp, "...");
+ }
+ aim_srv_setextrainfo(od, FALSE, 0, TRUE, status_text, NULL);
+ }
+ g_free(status_text);
+
+ /* Set a proper away message for icq too so that they work for old third party clients */
+
away = purple_prpl_oscar_convert_to_infotext(htmlaway, &awaylen, &away_encoding);
if (awaylen > od->rights.maxawaymsglen)
More information about the Commits
mailing list