Mercurial > pidgin.yaz
comparison src/protocols/jabber/message.c @ 7310:dd4b4a187171
[gaim-migrate @ 7894]
assorted jabber tweaks
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Tue, 21 Oct 2003 17:18:46 +0000 |
parents | 7c12dab8e513 |
children | 02b713a5c7e2 |
comparison
equal
deleted
inserted
replaced
7309:153fbf9b6a7f | 7310:dd4b4a187171 |
---|---|
76 char *from; | 76 char *from; |
77 | 77 |
78 JabberBuddy *jb; | 78 JabberBuddy *jb; |
79 JabberBuddyResource *jbr; | 79 JabberBuddyResource *jbr; |
80 | 80 |
81 if(!jid) | |
82 return; | |
83 | |
81 jb = jabber_buddy_find(jm->js, jm->from, TRUE); | 84 jb = jabber_buddy_find(jm->js, jm->from, TRUE); |
82 jbr = jabber_buddy_find_resource(jb, jid->resource); | 85 jbr = jabber_buddy_find_resource(jb, jid->resource); |
83 | 86 |
84 if(find_unnormalized_conv(jm->from, jm->js->gc->account)) { | 87 if(find_unnormalized_conv(jm->from, jm->js->gc->account)) { |
85 from = g_strdup(jm->from); | 88 from = g_strdup(jm->from); |
162 } | 165 } |
163 | 166 |
164 static void handle_groupchat(JabberMessage *jm) | 167 static void handle_groupchat(JabberMessage *jm) |
165 { | 168 { |
166 JabberID *jid = jabber_id_new(jm->from); | 169 JabberID *jid = jabber_id_new(jm->from); |
167 JabberChat *chat = jabber_chat_find(jm->js, jid->node, jid->domain); | 170 JabberChat *chat; |
171 | |
172 if(!jid) | |
173 return; | |
174 | |
175 chat = jabber_chat_find(jm->js, jid->node, jid->domain); | |
168 | 176 |
169 if(!chat) | 177 if(!chat) |
170 return; | 178 return; |
171 | 179 |
172 if(jm->subject) | 180 if(jm->subject) |
179 jabber_id_free(jid); | 187 jabber_id_free(jid); |
180 } | 188 } |
181 | 189 |
182 static void handle_groupchat_invite(JabberMessage *jm) | 190 static void handle_groupchat_invite(JabberMessage *jm) |
183 { | 191 { |
184 GHashTable *components = g_hash_table_new_full(g_str_hash, g_str_equal, | 192 GHashTable *components; |
185 g_free, g_free); | |
186 JabberID *jid = jabber_id_new(jm->to); | 193 JabberID *jid = jabber_id_new(jm->to); |
194 | |
195 if(!jid) | |
196 return; | |
197 | |
198 components = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); | |
187 | 199 |
188 g_hash_table_replace(components, g_strdup("room"), jid->node); | 200 g_hash_table_replace(components, g_strdup("room"), jid->node); |
189 g_hash_table_replace(components, g_strdup("server"), jid->node); | 201 g_hash_table_replace(components, g_strdup("server"), jid->node); |
190 g_hash_table_replace(components, g_strdup("handle"), jm->js->user->node); | 202 g_hash_table_replace(components, g_strdup("handle"), jm->js->user->node); |
191 g_hash_table_replace(components, g_strdup("password"), jm->password); | 203 g_hash_table_replace(components, g_strdup("password"), jm->password); |