soc.2009.transport: df416a48: Send Adhoc commands for buddies.
hanzz at soc.pidgin.im
hanzz at soc.pidgin.im
Thu May 28 07:41:29 EDT 2009
-----------------------------------------------------------------
Revision: df416a48d8c5517febc7e2a88764f52545a36125
Ancestor: 2c0a738d59985f221f43a6f4144e7d4105d24521
Author: hanzz at soc.pidgin.im
Date: 2009-05-28T08:51:41
Branch: im.pidgin.soc.2009.transport
URL: http://d.pidgin.im/viewmtn/revision/info/df416a48d8c5517febc7e2a88764f52545a36125
Modified files:
adhochandler.cpp protocols/facebook.cpp
ChangeLog:
Send Adhoc commands for buddies.
-------------- next part --------------
============================================================
--- adhochandler.cpp 33124457c0be2701924f80fc2d4885fee46c2e9e
+++ adhochandler.cpp 767d9a535e6d6567a449e393030e5149bf3d2700
@@ -77,6 +77,32 @@ DiscoNodeItemList AdhocHandler::handleDi
}
}
}
+ else {
+ User *user = main->userManager()->getUserByJID(from);
+ if (user) {
+ if (user->isConnected() && purple_account_get_connection(user->account())) {
+ GList *l, *ll;
+ PurpleConnection *gc = purple_account_get_connection(user->account());
+ PurplePlugin *plugin = gc && PURPLE_CONNECTION_IS_CONNECTED(gc) ? gc->prpl : NULL;
+ PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(plugin);
+
+ if(!prpl_info || !prpl_info->blist_node_menu)
+ return lst;
+
+ PurpleBuddy *buddy = purple_find_buddy(user->account(), JID(to).username().c_str());
+
+ for(l = ll = prpl_info->blist_node_menu((PurpleBlistNode*)buddy); l; l = l->next) {
+ PurpleMenuAction *action = (PurpleMenuAction *) l->data;
+ DiscoNodeItem item;
+ item.node = (std::string) action->label;
+ item.jid = to + "/bot";
+ item.name = (std::string) action->label;
+ purple_menu_action_free(action);
+ lst.push_back( item );
+ }
+ }
+ }
+ }
}
return lst;
}
============================================================
--- protocols/facebook.cpp 5c180c4e96e36e228cf7b381a644b96d6bed9e60
+++ protocols/facebook.cpp 41d9edf22a537bbb7300de6cc56ea6a069f2d912
@@ -33,6 +33,7 @@ FacebookProtocol::FacebookProtocol(Gloox
m_buddyFeatures.push_back("http://jabber.org/protocol/disco#info");
m_buddyFeatures.push_back("http://jabber.org/protocol/caps");
m_buddyFeatures.push_back("http://jabber.org/protocol/chatstates");
+ m_buddyFeatures.push_back("http://jabber.org/protocol/commands");
// load certificate from certificate.pem
PurpleCertificatePool *tls_peers;
More information about the Commits
mailing list