[Sugar-devel] [PATCH sugar] Gabble: do not add ourself to the model twice OLPC #10965

Simon Schampijer simon at schampijer.de
Thu Jun 30 04:21:15 EDT 2011


On 06/26/2011 03:19 PM, Simon Schampijer wrote:
> We do add ourself to the model by default. When we are connected
> to the server it often gives us as well ourself back.
>
> Signed-off-by: Simon Schampijer<simon at laptop.org>
> ---
>   src/jarabe/model/neighborhood.py |    5 +++++
>   1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/src/jarabe/model/neighborhood.py b/src/jarabe/model/neighborhood.py
> index 9a2852a..96cbb36 100644
> --- a/src/jarabe/model/neighborhood.py
> +++ b/src/jarabe/model/neighborhood.py
> @@ -594,6 +594,11 @@ class _Account(gobject.GObject):
>           for handle in attributes.keys():
>               nick = attributes[handle][CONNECTION_INTERFACE_ALIASING + '/alias']
>
> +            if handle == self._self_handle:
> +                logging.debug('_Account.__get_contact_attributes_cb,' \
> +                              ' do not add ourself %r', handle)
> +                continue
> +
>               if handle in self._buddy_handles and \
>                       not self._buddy_handles[handle] is None:
>                   logging.debug('Got handle %r with nick %r, going to update',

Tested-by: Samuel Greenfeld <greenfeld at laptop.org>

Sam did test this one as working.

Regards,
    Simon


More information about the Sugar-devel mailing list