Commit Graph

38 Commits

Author SHA1 Message Date
Simon McVittie
fd4e514e21 services/presence/buddy: Fix thinko - register Owner with correct objid
Previously the keyid/ prefix was missing.
2007-05-30 17:38:58 +01:00
Simon McVittie
a4a06206e3 services/presence/: identify Buddies by "key ID" (pubkey hash), not whole key.
This allows us to create Buddy objects as soon as we see a contact on the
server. For contacts not on trusted servers, or seen in anonymous MUCs, we
create a Buddy identified by JID instead (so we have some way to talk
about the anonymous contact within the Sugar API).

The concept of "trusted server" means a server which we trust to validate that
users with a keyID as the username part of their JID do in fact have that key.
Currently we just pretend that olpc.collabora.co.uk does this - in future, the
school servers will do this validation by using key rather than password
authentication.

Also create Buddy object paths based on the keyID or JID (for easier debugging).
2007-05-28 17:25:52 +01:00
Simon McVittie
9721436536 services/presence/: Pass the SessionBus around, instead of a BusName object.
Delay making the BusName object until after the PS object has been exported,
to guarantee race-free activation.
2007-05-25 16:21:02 +01:00
Simon McVittie
ad33f7dfdd services/presence/buddy: Improve docstring; remove unused property _object_id 2007-05-25 12:26:53 +01:00
Simon McVittie
1fa97c3d93 services/presence/buddy: Set attributes more concisely, improve docstrings 2007-05-25 12:24:32 +01:00
Simon McVittie
56b95264cf services/presence/psutils, buddy: Track NameOwnerChanged in IP4AddressMonitor
This means Buddy and its subclasses no longer need to care about
NameOwnerChanged at all.

The old code might not have worked anyway, since it was watching for
NameOwnerChanged on the session bus, but invoking NM methods on the system bus.
2007-05-25 12:14:39 +01:00
Simon McVittie
fdd8c315cf services/presence/buddy: Use add_signal_receiver to connect signals.
This means we don't need to care whether the Sugar shell is actually running -
if it is, we'll get its signals, and if it's not, obviously it can't send us
any signals!
2007-05-25 12:06:57 +01:00
Simon McVittie
eafd338d09 services/presence/buddy: Stop treating server, key_hash, registered as GObject properties.
They're not handled in the inherited do_set_property()/do_get_property(), so
won't work as properties, and there seems to be no need for them to be
properties at all.
This fixes the following assertion when importing buddy:

Warning: g_object_class_install_property: assertion `pspec->flags & G_PARAM_WRITABLE' failed
  type_register(cls, namespace.get('__gtype_name__'))
2007-05-25 11:34:54 +01:00
Simon McVittie
5bf10edaee services/presence/buddy: remove trailing whitespace, wrap long lines 2007-05-25 10:56:41 +01:00
Simon McVittie
f7ba2aa1e2 services/presence/: separate test code into a separate module 2007-05-24 18:58:58 +01:00
Simon McVittie
10e1daf8c6 services/presence/buddy.py: Don't allow the Owner to disappear, even if they have no handles left 2007-05-24 18:46:16 +01:00
Simon McVittie
a6e809a9ef services/presence/: move more of the handle tracking into the Buddy object 2007-05-24 18:46:09 +01:00
Simon McVittie
494e17b3cd Revert "services/presence/: move more of the handle tracking into the Buddy object".
It shouldn't have been applied before "services/presence: buddy: add mapping
to/from Telepathy handles" which has not yet been reviewed.

This reverts commit 78356b1956.

Conflicts:

	services/presence/presenceservice.py
2007-05-24 12:34:36 +01:00
Simon McVittie
66c5e882f3 Merge branch 'master' of git+ssh://dev.laptop.org/git/sugar 2007-05-21 11:30:38 +01:00
Simon McVittie
8c8dffe662 Merge commit 'origin' into submit 2007-05-21 11:27:47 +01:00
Simon McVittie
78356b1956 services/presence/: move more of the handle tracking into the Buddy object 2007-05-18 15:22:32 +01:00
Dan Williams
7b9c59fb9c Correctly send IPv4 address when NM already has a connection 2007-05-17 13:54:26 -04:00
Simon McVittie
f3a2d532f5 services/presence: buddy: add mapping to/from Telepathy handles 2007-05-17 17:41:42 +01:00
Dan Williams
d72ff8c6fb Don't try to shove None through dbus 2007-05-17 09:32:34 -04:00
Simon McVittie
4b26840333 sugar.presence.presenceservice, services/presence: Use named loggers.
This causes events in the log to be annotated with the module that emitted the
message.

Before: DEBUG - root: Starting up...
After: DEBUG - s-p-s.server_plugin: Starting up...

I've used a log domain of "sugar.presence..." for the client library and
e.g. "s-p-s.activity" for the service internals.
2007-05-15 14:58:15 +01:00
Dan Williams
5e2ea16e3a Redo PS connection handling; ensure valid network connection before talking to server 2007-05-13 21:34:15 -04:00
Simon McVittie
2216f5095d Use ExportedGObject from dbus-python rather than reimplementing it 2007-05-11 17:27:36 -04:00
Dan Williams
570c7e6052 Add buddy ip4-address property (temporary) 2007-04-30 23:44:39 -04:00
Dan Williams
e63accc8be Make test buddy attribute randomization optional 2007-04-29 18:01:23 -04:00
Dan Williams
60c9e0ecb8 Let PresenceService._buddy_activities_changed see all joined activities, even invalid ones 2007-04-21 19:20:06 -04:00
Dan Williams
51f56ed7a3 Join/leave activity when its validity changes 2007-04-21 19:09:59 -04:00
Mike's Primary Account
81d9bed0d8 Merge branch 'master' of git+ssh://mcfletch@dev.laptop.org/git/sugar
Conflicts:

	services/presence/buddy.py
2007-04-20 16:42:47 -04:00
Mike's Primary Account
c0c64809a0 Initial documentation pass for buddy objects 2007-04-20 16:25:37 -04:00
Dan Williams
2866d3c4c9 Convert more string-named properties to var-named 2007-04-20 12:40:53 -04:00
Dan Williams
37953c47f7 Use well-defined names for properties rather than strings 2007-04-20 12:34:16 -04:00
Dan Williams
26ed1d1504 Don't leak invalid properties 2007-04-17 13:27:34 -04:00
Dan Williams
99bf82b44f Make TestOwner create more realistic activities and switch between them 2007-04-16 22:44:54 -04:00
Dan Williams
3d3dd23390 Randomness tweak 2007-04-12 00:14:29 -04:00
Dan Williams
162a87f882 Create test owner for presence service
This owner changes properties periodically so we can test out the PS's handling
of property changes.  To execute, run Sugar and then make sure that the D-Bus
address is the one sugar is using (get it from ~/.sugar/default/session.info).
Then run:

build/bin/sugar-presence-service X

where X is a number 1 -> 9 inclusive.  It will generate fake buddy info for that
test buddy and then start up a presence service for that buddy, changing a random
property of the buddy every 10 seconds.
2007-04-11 22:49:14 -04:00
Marco Pesenti Gritti
3350d5772a Swap the classes order, which for some reason make it work on FC7 2007-04-10 20:29:34 +02:00
Dan Williams
48cab08b33 PS fixes; use correct type on public keys and hide invalid buddies 2007-04-10 10:59:35 -04:00
Dan Williams
bc083dae5a Cut over to new PresenceService 2007-04-09 14:40:56 -04:00
Dan Williams
2509d990e4 Cut over to new PresenceService 2007-04-09 14:40:50 -04:00