Mercurial > pidgin
comparison libpurple/protocols/jabber/jabber.c @ 20149:be2538a92099
Comment a partial implementation of the libpurple attention API for
XMPP. The implemented functions in the prpl_info struct are not yet
used, and requires further testing.
author | Jeffrey Connelly <jaconnel@calpoly.edu> |
---|---|
date | Sun, 23 Sep 2007 20:30:57 +0000 |
parents | ca7ab06673dd |
children | cb7d809867ac 02df6998b466 15f61e6b15cd |
comparison
equal
deleted
inserted
replaced
20148:e86f136e880e | 20149:be2538a92099 |
---|---|
2237 } | 2237 } |
2238 } | 2238 } |
2239 *error = g_strdup_printf(_("Unable to buzz, because the user %s does not support it."), args[0]); | 2239 *error = g_strdup_printf(_("Unable to buzz, because the user %s does not support it."), args[0]); |
2240 return PURPLE_CMD_RET_FAILED; | 2240 return PURPLE_CMD_RET_FAILED; |
2241 } | 2241 } |
2242 | |
2243 GList *jabber_attention_types(PurpleAccount *account) | |
2244 { | |
2245 static GList *types = NULL; | |
2246 PurpleAttentionType *attn; | |
2247 | |
2248 if (!types) { | |
2249 attn = g_new0(PurpleAttentionType, 1); | |
2250 attn->name = _("Buzz"); | |
2251 attn->incoming_description = _("%s has buzzed you!"); | |
2252 attn->outgoing_description = _("Buzzing %s..."); | |
2253 types = g_list_append(types, attn); | |
2254 } | |
2255 | |
2256 return types; | |
2257 } | |
2258 | |
2259 gboolean jabber_send_attention(PurpleConnection *gc, const char *username, guint code) | |
2260 { | |
2261 PurpleConversation *conv; | |
2262 char *error; | |
2263 char *args[1]; | |
2264 PurpleCmdRet ret; | |
2265 | |
2266 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, username, gc->account); | |
2267 | |
2268 args[0] = (char *)username; | |
2269 | |
2270 ret = jabber_cmd_buzz(conv, "buzz", args, &error, NULL); | |
2271 | |
2272 if (ret == PURPLE_CMD_RET_FAILED) { | |
2273 purple_debug_error("jabber", "jabber_send_attention: jabber_cmd_buzz failed with error: %s\n", error ? error : "(NULL)"); | |
2274 return FALSE; | |
2275 } else { | |
2276 return TRUE; | |
2277 } | |
2278 } | |
2279 | |
2242 | 2280 |
2243 gboolean jabber_offline_message(const PurpleBuddy *buddy) | 2281 gboolean jabber_offline_message(const PurpleBuddy *buddy) |
2244 { | 2282 { |
2245 return TRUE; | 2283 return TRUE; |
2246 } | 2284 } |