comparison libpurple/protocols/jabber/jabber.c @ 20643:cb7d809867ac

propagate from branch 'im.pidgin.pidgin' (head b2924d43f1e1cb2d01705932d9a06df6eedf7ac0) to branch 'im.pidgin.sadrul.currentmedia' (head 15698906f0fff90b76df130d6cebe3f183c2cfaf)
author Mark Doliner <mark@kingant.net>
date Tue, 25 Sep 2007 09:01:03 +0000
parents ba6cd9c25853 be2538a92099
children 5f829728a1a5
comparison
equal deleted inserted replaced
20642:ba6cd9c25853 20643:cb7d809867ac
2213 } 2213 }
2214 } 2214 }
2215 *error = g_strdup_printf(_("Unable to buzz, because the user %s does not support it."), args[0]); 2215 *error = g_strdup_printf(_("Unable to buzz, because the user %s does not support it."), args[0]);
2216 return PURPLE_CMD_RET_FAILED; 2216 return PURPLE_CMD_RET_FAILED;
2217 } 2217 }
2218
2219 GList *jabber_attention_types(PurpleAccount *account)
2220 {
2221 static GList *types = NULL;
2222 PurpleAttentionType *attn;
2223
2224 if (!types) {
2225 attn = g_new0(PurpleAttentionType, 1);
2226 attn->name = _("Buzz");
2227 attn->incoming_description = _("%s has buzzed you!");
2228 attn->outgoing_description = _("Buzzing %s...");
2229 types = g_list_append(types, attn);
2230 }
2231
2232 return types;
2233 }
2234
2235 gboolean jabber_send_attention(PurpleConnection *gc, const char *username, guint code)
2236 {
2237 PurpleConversation *conv;
2238 char *error;
2239 char *args[1];
2240 PurpleCmdRet ret;
2241
2242 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, username, gc->account);
2243
2244 args[0] = (char *)username;
2245
2246 ret = jabber_cmd_buzz(conv, "buzz", args, &error, NULL);
2247
2248 if (ret == PURPLE_CMD_RET_FAILED) {
2249 purple_debug_error("jabber", "jabber_send_attention: jabber_cmd_buzz failed with error: %s\n", error ? error : "(NULL)");
2250 return FALSE;
2251 } else {
2252 return TRUE;
2253 }
2254 }
2255
2218 2256
2219 gboolean jabber_offline_message(const PurpleBuddy *buddy) 2257 gboolean jabber_offline_message(const PurpleBuddy *buddy)
2220 { 2258 {
2221 return TRUE; 2259 return TRUE;
2222 } 2260 }