libpurple/protocols/jabber/usermood.c

Tue, 12 Jun 2007 00:28:06 +0000

author
Andreas Monitzer <am@adiumx.com>
date
Tue, 12 Jun 2007 00:28:06 +0000
branch
soc.2007.xmpp
changeset 17777
746809864dde
parent 17776
e5d36bb0093b
child 17778
620e63b7f67c
permissions
-rw-r--r--

Fixed naming to adhere to the libpurple convention

17776
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
1 /*
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
2 * purple - Jabber Protocol Plugin
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
3 *
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
4 * Copyright (C) 2007, Andreas Monitzer <andy@monitzer.com>
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
5 *
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
9 * (at your option) any later version.
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
10 *
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
14 * GNU General Public License for more details.
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
15 *
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
19 *
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
20 */
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
21
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
22 #include "usermood.h"
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
23 #include "pep.h"
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
24
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
25 #include <string.h>
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
26
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
27 static char *moodstrings[] = {
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
28 "afraid",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
29 "amazed",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
30 "angry",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
31 "annoyed",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
32 "anxious",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
33 "aroused",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
34 "ashamed",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
35 "bored",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
36 "brave",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
37 "calm",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
38 "cold",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
39 "confused",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
40 "contented",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
41 "cranky",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
42 "curious",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
43 "depressed",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
44 "disappointed",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
45 "disgusted",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
46 "distracted",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
47 "embarrassed",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
48 "excited",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
49 "flirtatious",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
50 "frustrated",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
51 "grumpy",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
52 "guilty",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
53 "happy",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
54 "hot",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
55 "humbled",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
56 "humiliated",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
57 "hungry",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
58 "hurt",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
59 "impressed",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
60 "in_awe",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
61 "in_love",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
62 "indignant",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
63 "interested",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
64 "intoxicated",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
65 "invincible",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
66 "jealous",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
67 "lonely",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
68 "mean",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
69 "moody",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
70 "nervous",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
71 "neutral",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
72 "offended",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
73 "playful",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
74 "proud",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
75 "relieved",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
76 "remorseful",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
77 "restless",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
78 "sad",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
79 "sarcastic",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
80 "serious",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
81 "shocked",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
82 "shy",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
83 "sick",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
84 "sleepy",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
85 "stressed",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
86 "surprised",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
87 "thirsty",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
88 "worried",
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
89 NULL
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
90 };
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
91
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
92 static void jabber_mood_cb(JabberStream *js, const char *from, xmlnode *items) {
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
93 /* it doesn't make sense to have more than one item here, so let's just pick the first one */
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
94 xmlnode *item = xmlnode_get_child(items, "item");
17777
746809864dde Fixed naming to adhere to the libpurple convention
Andreas Monitzer <am@adiumx.com>
parents: 17776
diff changeset
95 JabberMood newmood = UNKNOWN;
17776
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
96 char *moodtext = NULL;
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
97 JabberBuddy *buddy = jabber_buddy_find(js, from, FALSE);
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
98 /* ignore the mood of people not on our buddy list */
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
99 if(!buddy)
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
100 return;
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
101
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
102 if(item) {
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
103 xmlnode *mood = xmlnode_get_child_with_namespace(item, "mood", "http://jabber.org/protocol/mood");
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
104 if(mood) {
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
105 xmlnode *moodinfo;
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
106 for(moodinfo = mood->child; moodinfo != mood->lastchild; moodinfo = moodinfo->next) {
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
107 if(moodinfo->type == XMLNODE_TYPE_TAG) {
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
108 if(!strcmp(moodinfo->name, "text")) {
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
109 if(!moodtext) /* only pick the first one */
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
110 moodtext = xmlnode_get_data(moodinfo);
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
111 } else {
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
112 int i;
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
113 for(i = 0; moodstrings[i]; ++i) {
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
114 if(!strcmp(moodinfo->name, moodstrings[i])) {
17777
746809864dde Fixed naming to adhere to the libpurple convention
Andreas Monitzer <am@adiumx.com>
parents: 17776
diff changeset
115 newmood = (JabberMood)(i+1); /* 0 is "unknown", so we have to add 1 */
17776
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
116 break;
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
117 }
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
118 }
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
119 }
17777
746809864dde Fixed naming to adhere to the libpurple convention
Andreas Monitzer <am@adiumx.com>
parents: 17776
diff changeset
120 if(newmood != UNKNOWN && moodtext != NULL)
17776
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
121 break;
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
122 }
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
123 }
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
124 }
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
125 }
17777
746809864dde Fixed naming to adhere to the libpurple convention
Andreas Monitzer <am@adiumx.com>
parents: 17776
diff changeset
126 if(newmood != UNKNOWN) {
17776
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
127 JabberBuddyResource *resource = jabber_buddy_find_resource(buddy, NULL);
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
128 const char *status_id = jabber_buddy_state_get_status_id(resource->state);
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
129
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
130 purple_prpl_got_user_status(js->gc->account, from, status_id, "mood", newmood, "moodtext", moodtext?moodtext:"", NULL);
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
131 }
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
132 if(moodtext)
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
133 g_free(moodtext);
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
134 }
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
135
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
136 void jabber_mood_init(void) {
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
137 jabber_add_feature("mood", "http://jabber.org/protocol/mood");
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
138 jabber_pep_register_handler("moodn", "http://jabber.org/protocol/mood", jabber_mood_cb);
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
139 }
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
140
17777
746809864dde Fixed naming to adhere to the libpurple convention
Andreas Monitzer <am@adiumx.com>
parents: 17776
diff changeset
141 void jabber_set_mood(JabberStream *js, JabberMood mood, const char *text) {
17776
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
142 xmlnode *publish, *moodnode;
17777
746809864dde Fixed naming to adhere to the libpurple convention
Andreas Monitzer <am@adiumx.com>
parents: 17776
diff changeset
143 if(mood == UNKNOWN)
17776
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
144 return;
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
145
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
146 publish = xmlnode_new("publish");
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
147 xmlnode_set_attrib(publish,"node","http://jabber.org/protocol/mood");
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
148 moodnode = xmlnode_new_child(xmlnode_new_child(publish, "item"), "mood");
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
149 xmlnode_set_namespace(moodnode, "http://jabber.org/protocol/mood");
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
150 xmlnode_new_child(moodnode, moodstrings[mood-1]);
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
151
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
152 if(text) {
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
153 xmlnode *textnode = xmlnode_new_child(moodnode, "text");
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
154 xmlnode_insert_data(textnode, text, -1);
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
155 }
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
156
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
157 jabber_pep_publish(js, publish);
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
158
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
159 xmlnode_free(publish);
e5d36bb0093b forgot to add usermood.[hc]
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
160 }

mercurial