Bug 627402 Move default presence messages from Empathy to libfolks
authorJeremy Whiting <jpwhiting@kde.org>
Thu, 24 May 2012 20:31:40 +0000 (14:31 -0600)
committerTravis Reitter <travis.reitter@collabora.co.uk>
Thu, 24 May 2012 20:34:50 +0000 (13:34 -0700)
Move presence string mapping into folks from gnome-contacts.

Closes: https://bugzilla.gnome.org/show_bug.cgi?id=627402

NEWS
folks/presence-details.vala

diff --git a/NEWS b/NEWS
index d8b69a7..a4e6b01 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,9 @@ Bugs fixed:
 • Bug 675292 — Assertion when joining IRC channel
 • Bug 676023 — Invalid read when preparing the aggregator
 
+API changes:
+ Add PresenceDetails.get_default_message_from_type()
+
 Overview of changes from libfolks 0.6.9 to libfolks 0.7.0
 =========================================================
 
index 352cbd1..4dbd3bf 100644 (file)
@@ -142,6 +142,37 @@ public interface Folks.PresenceDetails : Object
     }
 
   /**
+   * The default message for a presence type.
+   *
+   * @since UNRELEASED
+   */
+  public static string get_default_message_from_type (PresenceType type)
+    {
+      switch (type)
+        {
+          default:
+          case PresenceType.UNKNOWN:
+            return _("Unknown status");
+          case PresenceType.OFFLINE:
+            return _("Offline");
+          case PresenceType.UNSET:
+            return "";
+          case PresenceType.ERROR:
+            return _("Error");
+          case PresenceType.AVAILABLE:
+            return _("Available");
+          case PresenceType.AWAY:
+            return _("Away");
+          case PresenceType.EXTENDED_AWAY:
+            return _("Extended away");
+          case PresenceType.BUSY:
+            return _("Busy");
+          case PresenceType.HIDDEN:
+            return _("Hidden");
+        }
+    }
+
+  /**
    * Compare two {@link PresenceType}s.
    *
    * `0` will be returned if the types are equal, a positive number will be