# HG changeset patch
# Node ID e1bfdc70dcc13657761d312dd7c54dc47938e253
# Parent  757575456cc20cfb510fb14008ce99a03ea4d3b1
diff --git a/pidgin/pidginconversation.c b/pidgin/pidginconversation.c
--- a/pidgin/pidginconversation.c
+++ b/pidgin/pidginconversation.c
@@ -51,6 +51,9 @@
 	GtkCustomSorter *memberlist_sorter;
 
 	GtkWidget *input;
+
+	GtkWidget *typing_label;
+	GtkWidget *status_label;
 };
 
 G_DEFINE_FINAL_TYPE(PidginConversation, pidgin_conversation, GTK_TYPE_BOX)
@@ -148,6 +151,38 @@
 /******************************************************************************
  * Callbacks
  *****************************************************************************/
+static char *
+pidgin_conversation_get_status_label(G_GNUC_UNUSED PidginConversation *conversation,
+                                     GError *error, gboolean online)
+{
+	const char *message = NULL;
+
+	if(error != NULL) {
+		message = error->message;
+	}
+
+	if(purple_strempty(message) && !online) {
+		message = g_strdup(_("Conversation offline"));
+	}
+
+	if(purple_strempty(message)) {
+		message = "";
+	}
+
+	return g_strdup(message);
+}
+
+static GtkWidget *
+pidgin_conversation_get_status_page(PidginConversation *conversation,
+                                    GError *error, gboolean online)
+{
+	if(error != NULL || !online) {
+		return g_object_ref(conversation->status_label);
+	}
+
+	return g_object_ref(conversation->typing_label);
+}
+
 static void
 pidgin_conversation_input_insert_text_cb(G_GNUC_UNUSED GtkTextBuffer *buffer,
                                          G_GNUC_UNUSED const GtkTextIter *iter,
@@ -398,10 +433,18 @@
 	                                     memberlist_sorter);
 	gtk_widget_class_bind_template_child(widget_class, PidginConversation,
 	                                     input);
+	gtk_widget_class_bind_template_child(widget_class, PidginConversation,
+	                                     typing_label);
+	gtk_widget_class_bind_template_child(widget_class, PidginConversation,
+	                                     status_label);
 
 	gtk_widget_class_bind_template_callback(widget_class,
 	                                        pidgin_conversation_escape_topic);
 	gtk_widget_class_bind_template_callback(widget_class,
+	                                        pidgin_conversation_get_status_label);
+	gtk_widget_class_bind_template_callback(widget_class,
+	                                        pidgin_conversation_get_status_page);
+	gtk_widget_class_bind_template_callback(widget_class,
 	                                        pidgin_conversation_input_insert_text_cb);
 	gtk_widget_class_bind_template_callback(widget_class,
 	                                        pidgin_conversation_input_delete_range_cb);
diff --git a/pidgin/resources/Conversations/conversation.ui b/pidgin/resources/Conversations/conversation.ui
--- a/pidgin/resources/Conversations/conversation.ui
+++ b/pidgin/resources/Conversations/conversation.ui
@@ -141,9 +141,49 @@
       </object>
     </child>
     <child>
-      <object class="PidginTypingLabel">
-        <binding name="conversation">
-          <lookup name="conversation">PidginConversation</lookup>
+      <object class="GtkStack">
+        <child>
+          <object class="GtkStackPage">
+            <property name="child">
+              <object class="PidginTypingLabel" id="typing_label">
+                <binding name="conversation">
+                  <lookup name="conversation">PidginConversation</lookup>
+                </binding>
+              </object>
+            </property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkStackPage">
+            <property name="child">
+              <object class="GtkLabel" id="status_label">
+                <property name="ellipsize">end</property>
+                <property name="xalign">0</property>
+                <property name="halign">fill</property>
+                <property name="hexpand">true</property>
+                <binding name="label">
+                  <closure type="gchararray" function="pidgin_conversation_get_status_label">
+                    <lookup name="error" type="PurpleConversation">
+                      <lookup name="conversation">PidginConversation</lookup>
+                    </lookup>
+                    <lookup name="online" type="PurpleConversation">
+                      <lookup name="conversation">PidginConversation</lookup>
+                    </lookup>
+                  </closure>
+                </binding>
+              </object>
+            </property>
+          </object>
+        </child>
+        <binding name="visible-child">
+          <closure type="GtkWidget" function="pidgin_conversation_get_status_page">
+            <lookup name="error" type="PurpleConversation">
+              <lookup name="conversation">PidginConversation</lookup>
+            </lookup>
+            <lookup name="online" type="PurpleConversation">
+              <lookup name="conversation">PidginConversation</lookup>
+            </lookup>
+          </closure>
         </binding>
       </object>
     </child>
