comparison libpurple/protocols/oscar/oscar.c @ 25451:9d931c8e9d90

The status_text variable is only used inside this block, so move it all up in there
author Mark Doliner <mark@kingant.net>
date Tue, 03 Mar 2009 20:29:11 +0000
parents cc9fb95cede5
children 8134074c05a3
comparison
equal deleted inserted replaced
25450:cc9fb95cede5 25451:9d931c8e9d90
4810 /* This is needed for us to un-set any previous away message. */ 4810 /* This is needed for us to un-set any previous away message. */
4811 away = g_strdup(""); 4811 away = g_strdup("");
4812 } 4812 }
4813 else 4813 else
4814 { 4814 {
4815 char *status_text = NULL;
4816 4815
4817 htmlaway = purple_status_get_attr_string(status, "message"); 4816 htmlaway = purple_status_get_attr_string(status, "message");
4818 if ((htmlaway == NULL) || (*htmlaway == '\0')) 4817 if ((htmlaway == NULL) || (*htmlaway == '\0'))
4819 htmlaway = purple_status_type_get_name(status_type); 4818 htmlaway = purple_status_type_get_name(status_type);
4820 4819
4821 /* ICQ 6.x seems to use an available message for all statuses so set one */ 4820 /* ICQ 6.x seems to use an available message for all statuses so set one */
4822 if (od->icq) 4821 if (od->icq)
4823 { 4822 {
4823 char *status_text;
4824
4824 status_text = purple_markup_strip_html(htmlaway); 4825 status_text = purple_markup_strip_html(htmlaway);
4826
4825 /* If the status_text is longer than 251 characters then truncate it */ 4827 /* If the status_text is longer than 251 characters then truncate it */
4826 if (strlen(status_text) > MAXAVAILMSGLEN) 4828 if (strlen(status_text) > MAXAVAILMSGLEN)
4827 { 4829 {
4828 char *tmp = g_utf8_find_prev_char(status_text, &status_text[MAXAVAILMSGLEN - 2]); 4830 char *tmp = g_utf8_find_prev_char(status_text, &status_text[MAXAVAILMSGLEN - 2]);
4829 strcpy(tmp, "..."); 4831 strcpy(tmp, "...");
4830 } 4832 }
4831 aim_srv_setextrainfo(od, FALSE, 0, TRUE, status_text, NULL); 4833 aim_srv_setextrainfo(od, FALSE, 0, TRUE, status_text, NULL);
4832 } 4834 g_free(status_text);
4833 g_free(status_text); 4835 }
4834 4836
4835 /* Set a proper away message for icq too so that they work for old third party clients */ 4837 /* Set a proper away message for icq too so that they work for old third party clients */
4836 4838
4837 away = purple_prpl_oscar_convert_to_infotext(htmlaway, &awaylen, &away_encoding); 4839 away = purple_prpl_oscar_convert_to_infotext(htmlaway, &awaylen, &away_encoding);
4838 4840