Display second phone number if the first one is not available
[beifahrer] / src / beifahrer-cli.vala
index aefa372..5ee78c8 100644 (file)
@@ -66,7 +66,16 @@ async void get_details (string href) {
                print ("\tvia %s\n", via);
        }
 
-       print ("Driver: %s (%s)\n", lift.name, lift.phone);
+       string phone;
+       if (lift.cell != null)
+               phone = lift.cell;
+       else if (lift.phone != null)
+               phone = lift.phone;
+       else if (lift.phone2 == null)
+               phone = lift.phone2;
+       else
+               phone = "";
+       print ("Driver: %s (%s)\n", lift.name, phone);
        print ("Description:\n%s\n", lift.description);
 
        loop.quit ();