# HG changeset patch # User Mark Doliner # Date 1133416723 0 # Node ID 4396691844e2d3cddeb86539b5d490491b1a7ab3 # Parent de27f283130920ad8a05df372b9a5f91be790f42 [gaim-migrate @ 14587] Make the Gaim 2.0.0 status.xml file not cause Gaim 1.5.0 to crash committer: Tailor Script diff -r de27f2831309 -r 4396691844e2 src/savedstatuses.c --- a/src/savedstatuses.c Thu Dec 01 05:52:21 2005 +0000 +++ b/src/savedstatuses.c Thu Dec 01 05:58:43 2005 +0000 @@ -170,7 +170,22 @@ node = xmlnode_new("status"); if (status->title != NULL) + { xmlnode_set_attrib(node, "name", status->title); + } + else + { + /* + * Gaim 1.5.0 and earlier require a name to be set, so we + * do this little hack to maintain backward compatability + * in the status.xml file. Eventually this should be used + * and we should determine if a status is transient by + * whether the "name" attribute is set to something or if + * it does not exist at all. + */ + xmlnode_set_attrib(node, "name", "Auto-Cached"); + xmlnode_set_attrib(node, "transient", "true"); + } snprintf(buf, sizeof(buf), "%lu", status->creation_time); xmlnode_set_attrib(node, "created", buf); @@ -336,9 +351,13 @@ ret = g_new0(GaimSavedStatus, 1); - /* Read the title */ - attrib = xmlnode_get_attrib(status, "name"); - ret->title = g_strdup(attrib); + attrib = xmlnode_get_attrib(status, "transient"); + if ((attrib == NULL) || (strcmp(attrib, "true"))) + { + /* Read the title */ + attrib = xmlnode_get_attrib(status, "name"); + ret->title = g_strdup(attrib); + } if (ret->title != NULL) {