| 101 cmedia_array = g_strsplit(cmedia, "\\0", 0); |
101 cmedia_array = g_strsplit(cmedia, "\\0", 0); |
| 102 |
102 |
| 103 strings = 0; |
103 strings = 0; |
| 104 while (strcmp(cmedia_array[++strings], "")); /* Yes, we want to skip the first empty string, apparently */ |
104 while (strcmp(cmedia_array[++strings], "")); /* Yes, we want to skip the first empty string, apparently */ |
| 105 |
105 |
| 106 buffer = g_string_new(NULL); |
|
| 107 |
|
| 108 if ((strings > 3) && (!strcmp(cmedia_array[2], "1"))) { /* Check if enabled */ |
106 if ((strings > 3) && (!strcmp(cmedia_array[2], "1"))) { /* Check if enabled */ |
| |
107 buffer = g_string_new(NULL); |
| 109 inptr = cmedia_array[3]; |
108 inptr = cmedia_array[3]; |
| 110 |
109 |
| 111 #if 0 |
110 #if 0 |
| 112 if(!strcmp(cmedia_array[1], "Music")) { |
111 if(!strcmp(cmedia_array[1], "Music")) { |
| 113 /* The music string seems to be of 'Title - Artist' form. */ |
112 /* The music string seems to be of 'Title - Artist' form. */ |
| 136 } else { |
135 } else { |
| 137 purple_debug_info("msn", "Current media marked disabled, not parsing\n"); |
136 purple_debug_info("msn", "Current media marked disabled, not parsing\n"); |
| 138 } |
137 } |
| 139 |
138 |
| 140 g_strfreev(cmedia_array); |
139 g_strfreev(cmedia_array); |
| 141 return g_string_free(buffer, FALSE); |
140 return buffer ? g_string_free(buffer, FALSE) : NULL; |
| 142 } |
141 } |
| 143 |
142 |
| 144 /* get the CurrentMedia info from the XML string */ |
143 /* get the CurrentMedia info from the XML string */ |
| 145 char * |
144 char * |
| 146 msn_get_currentmedia(char *xml_str, gsize len) |
145 msn_get_currentmedia(char *xml_str, gsize len) |