]> ToastFreeware Gitweb - gregoa/bti.git/blobdiff - bti.c
Verbose mode shows status IDs
[gregoa/bti.git] / bti.c
diff --git a/bti.c b/bti.c
index 4bf6a6c2a98b7a32b9edb556d841202988916e08..3987deca28ad6fa7ea2bbed7e40f577bd7f8bc94 100644 (file)
--- a/bti.c
+++ b/bti.c
@@ -317,6 +317,7 @@ static void parse_statuses(xmlDocPtr doc, xmlNodePtr current)
        xmlChar *text = NULL;
        xmlChar *user = NULL;
        xmlChar *created = NULL;
        xmlChar *text = NULL;
        xmlChar *user = NULL;
        xmlChar *created = NULL;
+       xmlChar *id = NULL;
        xmlNodePtr userinfo;
 
        current = current->xmlChildrenNode;
        xmlNodePtr userinfo;
 
        current = current->xmlChildrenNode;
@@ -326,6 +327,8 @@ static void parse_statuses(xmlDocPtr doc, xmlNodePtr current)
                                created = xmlNodeListGetString(doc, current->xmlChildrenNode, 1);
                        if (!xmlStrcmp(current->name, (const xmlChar *)"text"))
                                text = xmlNodeListGetString(doc, current->xmlChildrenNode, 1);
                                created = xmlNodeListGetString(doc, current->xmlChildrenNode, 1);
                        if (!xmlStrcmp(current->name, (const xmlChar *)"text"))
                                text = xmlNodeListGetString(doc, current->xmlChildrenNode, 1);
+                       if (!xmlStrcmp(current->name, (const xmlChar *)"id"))
+                               id = xmlNodeListGetString(doc, current->xmlChildrenNode, 1);
                        if (!xmlStrcmp(current->name, (const xmlChar *)"user")) {
                                userinfo = current->xmlChildrenNode;
                                while (userinfo != NULL) {
                        if (!xmlStrcmp(current->name, (const xmlChar *)"user")) {
                                userinfo = current->xmlChildrenNode;
                                while (userinfo != NULL) {
@@ -338,19 +341,21 @@ static void parse_statuses(xmlDocPtr doc, xmlNodePtr current)
                                }
                        }
 
                                }
                        }
 
-                       if (user && text && created) {
+                       if (user && text && created && id) {
                                if (verbose)
                                if (verbose)
-                                       printf("[%s] (%.16s) %s\n",
-                                               user, created, text);
+                                       printf("[%s] {%s} (%.16s) %s\n",
+                                               user, id, created, text);
                                else
                                        printf("[%s] %s\n",
                                                user, text);
                                xmlFree(user);
                                xmlFree(text);
                                xmlFree(created);
                                else
                                        printf("[%s] %s\n",
                                                user, text);
                                xmlFree(user);
                                xmlFree(text);
                                xmlFree(created);
+                               xmlFree(id);
                                user = NULL;
                                text = NULL;
                                created = NULL;
                                user = NULL;
                                text = NULL;
                                created = NULL;
+                               id = NULL;
                        }
                }
                current = current->next;
                        }
                }
                current = current->next;