summaryrefslogtreecommitdiff
path: root/Documentation/Recipes.mdwn
blob: ff6abab1e53db8a604ac5cd23d9070303e1e092a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45


# Telepathy Recipes

Simple overviews of how to accomplish various tasks with the Telepathy API. 


## Register an account

* Protocols which have accounts that can be registered automatically have a boolean "register" parameter. 
* Call `RequestConnection` with `register=True`. 
* If `Connect()` succeeds, registration has succeeded. 
* Don't rely on the connection being usable after registretion is finished. 

## Send a text message

* TODO 

## Make an audio call

* `RequestHandle` 
* `RequestChannel` 
* (no longer necessary since spec 0.17.6: `AddMember`) 
* `RequestStreams` 
* handle `MembersChanged` 
* handle `StreamError` 
See also: [[Streamed Media|Streamed Media]] 


## Block a contact

* TODO 

## Look for installed connection managers

* Call [[ListNames|ListNames]]() and [[ListActivatableNames|ListActivatableNames]]() on the D-Bus daemon 
* Search in the results for names beginning with `org.freedesktop.Telepathy.ConnectionManager.` 
* The rest of the bus name is the connection manager name 
* tp_list_connection_managers() in telepathy-glib >= 0.7.1 implements this correctly 

## Reuse an existing connection

* Search for names on the bus beginning with `org.freedesktop.Telepathy.Connection.` 
* tp_list_connection_names() in telepathy-glib >= 0.7.1 implements this correctly 
* If you want presence information, you can call `GetPresence` on the `subscribe` contact list to get cached presence information