Review Request: Make contact list presence subscription aware

David Edmundson kde at davidedmundson.co.uk
Thu Apr 21 17:46:36 CEST 2011



> On April 21, 2011, 3:13 p.m., David Edmundson wrote:
> > main-widget.cpp, line 348
> > <http://git.reviewboard.kde.org/r/101134/diff/1-2/?file=14477#file14477line348>
> >
> >     It's possible for the account to be ready and connected before the ContactManager is ready (ContactListStateSuccess). At which point allKnownContacts() returns an empty list if you use it too early. I think this code falls into that trap, at which point we may miss contacts that were added whilst we were offline.
> 
> Dario Freddi wrote:
>     This is actually the point which drove me mad while testing. In a situation where the user starts the contact list already connected, everything works fine as the Contact manager is guaranteed to be ready, but you are indeed right when connecting the accounts from within the list. Any hints on how to improve that specific situation?

What I did in the model was to connect 

void onAccountHasJustComeOnline()
{
  connect(connectionManager.data(),stateChanged(state), onStateChanged(state));
  onStateChanged(connectionManager->status());
}

then 
void onConnectionManagerStateChanged(status)
{
  if (status == ContactListStateSuccess) {
       do stuff that uses allKnownContacts.
  }
}


OR

you could watch the main model (not the filtered one) for when contacts are added (rowsInserted) as this will also contain all new people who are in the pending subscription state.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/101134/#review2807
-----------------------------------------------------------


On April 21, 2011, 1:34 p.m., Dario Freddi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/101134/
> -----------------------------------------------------------
> 
> (Updated April 21, 2011, 1:34 p.m.)
> 
> 
> Review request for Telepathy.
> 
> 
> Summary
> -------
> 
> This is a simple hack to make contact list aware of new presence subscription requests. It consists of a modal dialog - in a bright future where this will be moved out, it will be displayed as a KNotification instead. To ease the user's life, on acceptance the request is accepted and a subscription is made (a-la-windows live).
> 
> 
> This addresses bug 270665.
>     http://bugs.kde.org/show_bug.cgi?id=270665
> 
> 
> Diffs
> -----
> 
>   main-widget.h 9180d64de553487de089d7ef907b444dc742a92f 
>   main-widget.cpp 305a453f5162e688e28b9345eada3cfaecea2325 
> 
> Diff: http://git.reviewboard.kde.org/r/101134/diff
> 
> 
> Testing
> -------
> 
> Briefly tested and working, needs more testing.
> 
> 
> Thanks,
> 
> Dario
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-telepathy/attachments/20110421/8d9d2b8a/attachment-0001.htm 


More information about the KDE-Telepathy mailing list