maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   List of IM logged-in contacts? (https://talk.maemo.org/showthread.php?t=61334)

Marcus 2010-08-29 07:47

List of IM logged-in contacts?
 
Hey guys.

Is it possible to get a list of the logged-in contacts that are you using IM?

What I'd like to do is to create a Python script which pops up a notification whenever a contact of mine logs in, but where, or how, could I possibly find that "list"?

Regards,
Marcus

m0da 2010-08-29 08:20

Re: List of IM logged-in contacts?
 
open your contacts -> press all contacts at the top -> press availability at the top.

it'll sort your list based on who's online.

Marcus 2010-08-29 08:28

Re: List of IM logged-in contacts?
 
Obviously that is not what I'm interested in though. I need to "read" the list within my application.

lma 2010-08-29 09:54

Re: List of IM logged-in contacts?
 
You probably want telepathy-python, see the roster.py example in particular.

Marcus 2010-08-29 10:53

Re: List of IM logged-in contacts?
 
I must admit that I've never looked into Telepathy, perhaps you could show me the spot where roster.py outputs the online contacts?

Diph 2010-08-29 14:14

Re: List of IM logged-in contacts?
 
You can use Qt Mobility Contacts API.

Marcus 2010-08-29 14:20

Re: List of IM logged-in contacts?
 
Diph: That requires that I loop through all my contacts to check if they are online, correct?

Diph 2010-08-29 15:26

Re: List of IM logged-in contacts?
 
Use QContactManager. I don't know about Python, but in Qt C++ you can get all contacts from manager and then listen contactsChanged() signal which notifys when contact has been modified. Then get presence state from contact.

E: You can also get filtered list of contacts from manager if you want to get only IM contacts.

Marcus 2010-08-29 16:11

Re: List of IM logged-in contacts?
 
So I guess there is no possible way without Qt? I have not been messing with Qt much.

Diph 2010-08-29 16:19

Re: List of IM logged-in contacts?
 
Never mind, check Imas link.


All times are GMT. The time now is 20:30.

vBulletin® Version 3.8.8