diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-06-07 18:55:33 (GMT) |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-06-07 18:55:33 (GMT) |
commit | 982fb0247963c4a7d113422fc729955c5dd71e2a (patch) | |
tree | 43300aa61d020595f53c421940488eae6bf202e3 | |
parent | 74c976cd82afb8121ace452139a48461f9e51172 (diff) |
activity, server_plugin: inline ServerPlugin.update_activity_properties() into Activity.__init__
-rw-r--r-- | src/activity.py | 11 | ||||
-rw-r--r-- | src/server_plugin.py | 12 |
2 files changed, 10 insertions, 13 deletions
diff --git a/src/activity.py b/src/activity.py index 71e18b8..85f9f98 100644 --- a/src/activity.py +++ b/src/activity.py @@ -170,7 +170,16 @@ class Activity(ExportedGObject): # If not yet valid, query activity properties if not self._valid: - tp.update_activity_properties(self._id) + assert self._room, self._room + conn = self._tp.get_connection() + + def got_properties_err(e): + _logger.warning('Failed to get initial activity properties ' + 'for %s: %s', self._id, e) + + conn[CONN_INTERFACE_ACTIVITY_PROPERTIES].GetProperties(self._room, + reply_handler=self.set_properties, + error_handler=got_properties_err) def do_get_property(self, pspec): """Gets the value of a property associated with this activity. diff --git a/src/server_plugin.py b/src/server_plugin.py index 88652bc..7cecbea 100644 --- a/src/server_plugin.py +++ b/src/server_plugin.py @@ -973,18 +973,6 @@ class ServerPlugin(gobject.GObject): CHANNEL_TYPE_STREAMED_MEDIA)): self.emit("private-invitation", object_path) - def update_activity_properties(self, act_id): - """Request update from network on the activity properties of act_id""" - handle = self._activities.get(act_id) - if not handle: - raise RuntimeError("Unknown activity %s: couldn't find handle.") - - self._conn[CONN_INTERFACE_ACTIVITY_PROPERTIES].GetProperties(handle, - reply_handler=lambda *args: self._activity_properties_changed_cb( - handle, *args), - error_handler=lambda e: self._log_error_cb( - "getting activity properties", e)) - def set_activity_properties(self, act_id, props): """Send update to network on the activity properties of act_id (props). """ |