aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-message.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-07-27 23:13:44 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-07-27 23:13:44 +0800
commit8d2fed5419db02570826e964f4e48f57d81b2dab (patch)
treecf8832e2d5402f324757c22a20be8d92f68ca1d3 /libempathy/empathy-message.c
parente3430585a46b0965258237520314b185f4d59ec4 (diff)
downloadgsoc2013-empathy-8d2fed5419db02570826e964f4e48f57d81b2dab.tar
gsoc2013-empathy-8d2fed5419db02570826e964f4e48f57d81b2dab.tar.gz
gsoc2013-empathy-8d2fed5419db02570826e964f4e48f57d81b2dab.tar.bz2
gsoc2013-empathy-8d2fed5419db02570826e964f4e48f57d81b2dab.tar.lz
gsoc2013-empathy-8d2fed5419db02570826e964f4e48f57d81b2dab.tar.xz
gsoc2013-empathy-8d2fed5419db02570826e964f4e48f57d81b2dab.tar.zst
gsoc2013-empathy-8d2fed5419db02570826e964f4e48f57d81b2dab.zip
Add message type in log files. Fixes bug #459579.
2007-07-27 Xavier Claessens <xclaesse@gmail.com> * libempathy/empathy-message.c: * libempathy/empathy-message.h: * libempathy/empathy-log-manager.c: Add message type in log files. Fixes bug #459579. * doc/*: Updated. svn path=/trunk/; revision=205
Diffstat (limited to 'libempathy/empathy-message.c')
-rw-r--r--libempathy/empathy-message.c45
1 files changed, 39 insertions, 6 deletions
diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c
index 8b4751ee2..0ff2567bf 100644
--- a/libempathy/empathy-message.c
+++ b/libempathy/empathy-message.c
@@ -31,12 +31,11 @@
typedef struct _EmpathyMessagePriv EmpathyMessagePriv;
struct _EmpathyMessagePriv {
- EmpathyMessageType type;
- EmpathyContact *sender;
- EmpathyContact *receiver;
- gchar *body;
- EmpathyTime timestamp;
-
+ EmpathyMessageType type;
+ EmpathyContact *sender;
+ EmpathyContact *receiver;
+ gchar *body;
+ EmpathyTime timestamp;
};
static void empathy_message_class_init (EmpathyMessageClass *class);
@@ -416,3 +415,37 @@ empathy_message_set_timestamp (EmpathyMessage *message,
g_object_notify (G_OBJECT (message), "timestamp");
}
+EmpathyMessageType
+empathy_message_type_from_str (const gchar *type_str)
+{
+ if (strcmp (type_str, "normal") == 0) {
+ return EMPATHY_MESSAGE_TYPE_NORMAL;
+ }
+ if (strcmp (type_str, "action") == 0) {
+ return EMPATHY_MESSAGE_TYPE_ACTION;
+ }
+ else if (strcmp (type_str, "notice") == 0) {
+ return EMPATHY_MESSAGE_TYPE_NOTICE;
+ }
+ else if (strcmp (type_str, "auto-reply") == 0) {
+ return EMPATHY_MESSAGE_TYPE_AUTO_REPLY;
+ }
+
+ return EMPATHY_MESSAGE_TYPE_NORMAL;
+}
+
+const gchar *
+empathy_message_type_to_str (EmpathyMessageType type)
+{
+ switch (type) {
+ case EMPATHY_MESSAGE_TYPE_ACTION:
+ return "action";
+ case EMPATHY_MESSAGE_TYPE_NOTICE:
+ return "notice";
+ case EMPATHY_MESSAGE_TYPE_AUTO_REPLY:
+ return "auto-reply";
+ default:
+ return "normal";
+ }
+}
+