*/
using GLib;
+using Tp.PersonaStore;
public class Tp.IndividualAggregator : Object {
+ /* FIXME: cut this?
+ private HashTable stores;
+ */
+
public IndividualAggregator () {
+ /* FIXME: see if Gee has something better here
+ this.stores = new HashTable ();
+ */
+
+ AccountManager manager = AccountManager.dup ();
+ /* FIXME: cut the GLib */
+ unowned GLib.List<Account> accounts =
+ manager.get_valid_accounts ();
+
+ /* FIXME: cut this
+ Account first_account = accounts.first().data;
+
+ stdout.printf ("first account: %p (%s: '%s'), presence: %d\n",
+ first_account,
+ first_account.get_protocol (),
+ first_account.get_display_name (),
+ first_account.get_current_presence (null, null));
+ */
+
+ foreach (Account account in accounts) {
+ PersonaStore store;
+
+ /* FIXME: add this to this's hash */
+ store = new PersonaStore (account);
+
+ }
}
public void some_method () {
using GLib;
using Tp.Individual;
+using Tp.Channel;
+using Tp.Handle;
+using Tp.Account;
+using Tp.AccountManager;
+/* FIXME: split out the TpAccount-specific parts into a new subclass, since
+ * PersonaStore should also be used by non-Telepathy sources */
public class Tp.PersonaStore : Object {
- public PersonaStore () {
- }
-
- /* FIXME: cut this */
- public void some_method () {
- Individual individual = new Individual ();
+ [Property(nick = "basis account",
+ blurb = "Telepathy account this store is based upon")]
+ public Account account { get; construct; }
+ public PersonaStore (Account account) {
/* FIXME: cut this */
- stdout.printf ("telepathy-people says hello with individual %p!\n",
- individual);
+ stdout.printf ("creating PersonaStore from account: %p (%s: '%s'), presence: %d\n",
+ account,
+ account.get_protocol (),
+ account.get_display_name (),
+ account.get_current_presence (null, null));
+
+ Object (account: account);
}
}