Permalink
Browse files

getting basic account/protocol information.

  • Loading branch information...
robertbasic committed Dec 18, 2011
1 parent dde3596 commit 706136bec1896adf1ef7d9c35f8a85236d9e36fd
Showing with 20 additions and 0 deletions.
  1. +20 −0 dbus/pidgin-account.php
View
@@ -0,0 +1,20 @@
+<?php
+
+$dbus = new Dbus;
+
+$proxy = $dbus->createProxy("im.pidgin.purple.PurpleService",
+ "/im/pidgin/purple/PurpleObject",
+ "im.pidgin.purple.PurpleInterface");
+
+$accounts = $proxy->PurpleAccountsGetAllActive();
+
+foreach ($accounts->getData() as $account) {
+ if ($proxy->PurpleAccountIsConnected($account)) {
+ $username = $proxy->PurpleAccountGetUsername($account);
+ $protocolId = $proxy->PurpleAccountGetProtocolId($account);
+ $protocolName = $proxy->PurpleAccountGetProtocolName($account);
+ echo $username . " is connected on the " . $protocolName . " (" . $protocolId . ") protocol.\n";
+ }
+}
+
+?>

0 comments on commit 706136b

Please sign in to comment.