# HG changeset patch # User Sadrul Habib Chowdhury # Date 1190319537 0 # Node ID 1933f2084eb3455bf5b3f37e143837b4b96c38fb # Parent 5913725cbcd6ab62f15fc0efc1f40ff023d3dae4 Remove commented out code, and add soem notes. diff -r 5913725cbcd6 -r 1933f2084eb3 libpurple/protocols/msn/state.c --- a/libpurple/protocols/msn/state.c Thu Sep 20 16:30:17 2007 +0000 +++ b/libpurple/protocols/msn/state.c Thu Sep 20 20:18:57 2007 +0000 @@ -98,9 +98,17 @@ cmedia_array = g_strsplit(cmedia, "\\0", 0); + /* + * 0: Media Player + * 1: 'Music' + * 2: '1' if enabled, '0' if not + * 3: Format (eg. {0} by {1}) + * 4: Title + * 5: Artist + * 6: Album + * 7: ? + */ strings = 0; - /* Yes, we want to skip the first element here, as it is empty due to - * the cmedia string starting with \0 -- see the examples below. */ while (cmedia_array[++strings] != NULL); if (strings < 4) @@ -125,42 +133,6 @@ media->album = NULL; return TRUE; - -#if 0 - /* The cmedia_array[2] field contains a 1 if enabled. */ - if ((strings > 3) && (!strcmp(cmedia_array[2], "1"))) { - char *inptr = cmedia_array[3]; - - buffer = g_string_new(NULL); - - while (*inptr != '\0') { - if ((*inptr == '{') && ((*(inptr + 1) != '\0') && (*(inptr+2) == '}'))) { - char *tmpptr; - int tmp; - - errno = 0; - tmp = strtol(inptr + 1, &tmpptr, 10); - - if (errno == 0 && tmpptr != inptr + 1 && - tmp + 4 < strings) { - /* Replace {?} tag with appropriate text only when successful. - * Skip otherwise. */ - buffer = g_string_append(buffer, cmedia_array[tmp + 4]); - } - inptr += 3; /* Skip to the next char after '}' */ - } else { - buffer = g_string_append_c(buffer, *inptr++); - } - } - purple_debug_info("msn", "Parsed currentmedia string, result: \"%s\"\n", - buffer->str); - } else { - purple_debug_info("msn", "Current media marked disabled, not parsing.\n"); - } - - g_strfreev(cmedia_array); - return buffer ? g_string_free(buffer, FALSE) : NULL; -#endif } /* get the CurrentMedia info from the XML string */