chatview: show uri even when there is only one

The combobox containing the uri choice is always shown now, even if
there is only one CM. In the case of one CM, the comobox is insensitive.

Change-Id: Iff077482d2cf003405ea7b1c3f9e8a4c3a6a2660
Tuleap: #645
diff --git a/src/chatview.cpp b/src/chatview.cpp
index 8a922de..87b6c13 100644
--- a/src/chatview.cpp
+++ b/src/chatview.cpp
@@ -354,14 +354,20 @@
     g_return_if_fail(IS_CHAT_VIEW(self));
     ChatViewPrivate *priv = CHAT_VIEW_GET_PRIVATE(self);
 
-    g_return_if_fail(priv->person);
+    g_return_if_fail(priv->person || priv->cm);
 
     /* model for the combobox for the choice of ContactMethods */
     auto cm_model = gtk_list_store_new(
         1, G_TYPE_POINTER
     );
 
-    auto cms = priv->person->phoneNumbers();
+    Person::ContactMethods cms;
+
+    if (priv->person)
+        cms = priv->person->phoneNumbers();
+    else
+        cms << priv->cm;
+
     for (int i = 0; i < cms.size(); ++i) {
         GtkTreeIter iter;
         gtk_list_store_append(cm_model, &iter);
@@ -397,11 +403,9 @@
         gtk_combo_box_set_active(GTK_COMBO_BOX(priv->combobox_cm), last_used_cm_idx);
     }
 
-    /* show the combo box if there is more than one cm to choose from */
-    if (cms.size() > 1)
-        gtk_widget_show_all(priv->combobox_cm);
-    else
-        gtk_widget_hide(priv->combobox_cm);
+    /* if there is only one CM, make the combo box insensitive */
+    if (cms.size() < 2)
+        gtk_widget_set_sensitive(priv->combobox_cm, FALSE);
 }
 
 static void
@@ -446,6 +450,7 @@
 
     priv->cm = cm;
     print_text_recording(priv->cm->textRecording(), self);
+    update_contact_methods(self);
     update_name(self);
 
     gtk_widget_show(priv->hbox_chat_info);