author | Da Risk <da_risk@beem-project.com> |
Sun, 15 Mar 2015 18:03:03 +0100 | |
changeset 1044 | 197a85a35cba |
parent 964 | src/com/beem/project/beem/service/XmppFacade.java@89dbb4bee206 |
child 1053 | ba37a871aac2 |
permissions | -rw-r--r-- |
577 | 1 |
/* |
567 | 2 |
BEEM is a videoconference application on the Android Platform. |
3 |
||
4 |
Copyright (C) 2009 by Frederic-Charles Barthelery, |
|
5 |
Jean-Manuel Da Silva, |
|
6 |
Nikita Kozlov, |
|
7 |
Philippe Lago, |
|
8 |
Jean Baptiste Vergely, |
|
577 | 9 |
Vincent Veronis. |
567 | 10 |
|
11 |
This file is part of BEEM. |
|
12 |
||
13 |
BEEM is free software: you can redistribute it and/or modify |
|
14 |
it under the terms of the GNU General Public License as published by |
|
15 |
the Free Software Foundation, either version 3 of the License, or |
|
16 |
(at your option) any later version. |
|
17 |
||
18 |
BEEM is distributed in the hope that it will be useful, |
|
19 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
20 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
21 |
GNU General Public License for more details. |
|
22 |
||
23 |
You should have received a copy of the GNU General Public License |
|
24 |
along with BEEM. If not, see <http://www.gnu.org/licenses/>. |
|
25 |
||
26 |
Please send bug reports with examples or suggestions to |
|
27 |
contact@beem-project.com or http://dev.beem-project.com/ |
|
28 |
||
577 | 29 |
Epitech, hereby disclaims all copyright interest in the program "Beem" |
567 | 30 |
written by Frederic-Charles Barthelery, |
31 |
Jean-Manuel Da Silva, |
|
32 |
Nikita Kozlov, |
|
33 |
Philippe Lago, |
|
34 |
Jean Baptiste Vergely, |
|
35 |
Vincent Veronis. |
|
36 |
||
37 |
Nicolas Sadirac, November 26, 2009 |
|
38 |
President of Epitech. |
|
39 |
||
40 |
Flavien Astraud, November 26, 2009 |
|
41 |
Head of the EIP Laboratory. |
|
42 |
||
934
6b30719f4de6
merge otr repo with trunk
Nikita Kozlov <nikita@elyzion.net>
parents:
929
diff
changeset
|
43 |
*/ |
38
3e76846c48a9
We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff
changeset
|
44 |
package com.beem.project.beem.service; |
72
cdedc3a25d39
Show a progress dialog during connection with the server
Da Risk <darisk972@gmail.com>
parents:
68
diff
changeset
|
45 |
|
870
d23d8ad3b9ba
Add a basic way to publish avatar.
Da Risk <darisk972@gmail.com>
parents:
809
diff
changeset
|
46 |
import android.net.Uri; |
38
3e76846c48a9
We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff
changeset
|
47 |
import android.os.RemoteException; |
106
a9bc9297dff7
Amelioration de la methode change status.
Da Risk <darisk972@gmail.com>
parents:
72
diff
changeset
|
48 |
|
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
49 |
import com.beem.project.beem.BeemService; |
57
c91278dda166
La facade et la connexion permette de recuperer une instance de ChatManager
Da Risk <darisk972@gmail.com>
parents:
55
diff
changeset
|
50 |
import com.beem.project.beem.service.aidl.IChatManager; |
518
6b8089c9b834
Creation de l'activite PrivacyList et d'une interface PrivacyListListener ainsi que son implementation.
Jean-Manuel Da Silva <dasilvj@gmail.com>
parents:
515
diff
changeset
|
51 |
import com.beem.project.beem.service.aidl.IPrivacyListManager; |
38
3e76846c48a9
We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff
changeset
|
52 |
import com.beem.project.beem.service.aidl.IRoster; |
55
66732dd2cb77
Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents:
38
diff
changeset
|
53 |
import com.beem.project.beem.service.aidl.IXmppConnection; |
72
cdedc3a25d39
Show a progress dialog during connection with the server
Da Risk <darisk972@gmail.com>
parents:
68
diff
changeset
|
54 |
import com.beem.project.beem.service.aidl.IXmppFacade; |
155 | 55 |
import com.beem.project.beem.utils.PresenceType; |
55
66732dd2cb77
Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents:
38
diff
changeset
|
56 |
|
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
57 |
import org.jivesoftware.smack.packet.Presence; |
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
58 |
|
38
3e76846c48a9
We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff
changeset
|
59 |
/** |
55
66732dd2cb77
Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents:
38
diff
changeset
|
60 |
* This class is a facade for the Beem Service. |
38
3e76846c48a9
We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff
changeset
|
61 |
* @author darisk |
3e76846c48a9
We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff
changeset
|
62 |
*/ |
67
8c3870db8e31
Rename some XMPP* classes in Xmpp*
Da Risk <darisk972@gmail.com>
parents:
57
diff
changeset
|
63 |
public class XmppFacade extends IXmppFacade.Stub { |
38
3e76846c48a9
We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff
changeset
|
64 |
|
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
65 |
private XmppConnectionAdapter mConnexion; |
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
66 |
private final BeemService service; |
38
3e76846c48a9
We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff
changeset
|
67 |
|
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
68 |
/** |
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
69 |
* Create an XmppFacade. |
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
70 |
* |
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
71 |
* @param service the service providing the facade |
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
72 |
*/ |
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
73 |
public XmppFacade(final BeemService service) { |
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
74 |
this.service = service; |
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
75 |
} |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
76 |
|
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
77 |
/** |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
78 |
* {@inheritDoc} |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
79 |
*/ |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
80 |
@Override |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
81 |
public void changeStatus(int status, String msg) { |
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
82 |
initConnection(); |
524
e1a9ba4611dc
Ajout d'options pour definir sa ressource et sa priorité
Da Risk <darisk972@gmail.com>
parents:
503
diff
changeset
|
83 |
mConnexion.changeStatus(status, msg); |
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
84 |
} |
212 | 85 |
|
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
86 |
/** |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
87 |
* {@inheritDoc} |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
88 |
*/ |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
89 |
@Override |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
90 |
public void connectAsync() throws RemoteException { |
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
91 |
initConnection(); |
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
92 |
mConnexion.connectAsync(); |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
93 |
} |
38
3e76846c48a9
We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff
changeset
|
94 |
|
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
95 |
/** |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
96 |
* {@inheritDoc} |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
97 |
*/ |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
98 |
@Override |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
99 |
public void connectSync() throws RemoteException { |
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
100 |
initConnection(); |
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
101 |
mConnexion.connectSync(); |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
102 |
} |
38
3e76846c48a9
We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff
changeset
|
103 |
|
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
104 |
/** |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
105 |
* {@inheritDoc} |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
106 |
*/ |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
107 |
@Override |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
108 |
public IXmppConnection createConnection() throws RemoteException { |
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
109 |
initConnection(); |
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
110 |
return mConnexion; |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
111 |
} |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
112 |
|
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
113 |
/** |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
114 |
* {@inheritDoc} |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
115 |
*/ |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
116 |
@Override |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
117 |
public void disconnect() throws RemoteException { |
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
118 |
initConnection(); |
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
119 |
mConnexion.disconnect(); |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
120 |
} |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
121 |
|
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
122 |
/** |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
123 |
* {@inheritDoc} |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
124 |
*/ |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
125 |
@Override |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
126 |
public IChatManager getChatManager() throws RemoteException { |
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
127 |
initConnection(); |
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
128 |
return mConnexion.getChatManager(); |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
129 |
} |
38
3e76846c48a9
We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff
changeset
|
130 |
|
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
131 |
/** |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
132 |
* {@inheritDoc} |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
133 |
*/ |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
134 |
@Override |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
135 |
public IRoster getRoster() throws RemoteException { |
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
136 |
initConnection(); |
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
137 |
return mConnexion.getRoster(); |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
138 |
} |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
139 |
|
518
6b8089c9b834
Creation de l'activite PrivacyList et d'une interface PrivacyListListener ainsi que son implementation.
Jean-Manuel Da Silva <dasilvj@gmail.com>
parents:
515
diff
changeset
|
140 |
/** |
6b8089c9b834
Creation de l'activite PrivacyList et d'une interface PrivacyListListener ainsi que son implementation.
Jean-Manuel Da Silva <dasilvj@gmail.com>
parents:
515
diff
changeset
|
141 |
* {@inheritDoc} |
6b8089c9b834
Creation de l'activite PrivacyList et d'une interface PrivacyListListener ainsi que son implementation.
Jean-Manuel Da Silva <dasilvj@gmail.com>
parents:
515
diff
changeset
|
142 |
*/ |
6b8089c9b834
Creation de l'activite PrivacyList et d'une interface PrivacyListListener ainsi que son implementation.
Jean-Manuel Da Silva <dasilvj@gmail.com>
parents:
515
diff
changeset
|
143 |
@Override |
6b8089c9b834
Creation de l'activite PrivacyList et d'une interface PrivacyListListener ainsi que son implementation.
Jean-Manuel Da Silva <dasilvj@gmail.com>
parents:
515
diff
changeset
|
144 |
public IPrivacyListManager getPrivacyListManager() { |
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
145 |
initConnection(); |
518
6b8089c9b834
Creation de l'activite PrivacyList et d'une interface PrivacyListListener ainsi que son implementation.
Jean-Manuel Da Silva <dasilvj@gmail.com>
parents:
515
diff
changeset
|
146 |
return mConnexion.getPrivacyListManager(); |
6b8089c9b834
Creation de l'activite PrivacyList et d'une interface PrivacyListListener ainsi que son implementation.
Jean-Manuel Da Silva <dasilvj@gmail.com>
parents:
515
diff
changeset
|
147 |
} |
6b8089c9b834
Creation de l'activite PrivacyList et d'une interface PrivacyListListener ainsi que son implementation.
Jean-Manuel Da Silva <dasilvj@gmail.com>
parents:
515
diff
changeset
|
148 |
|
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
149 |
@Override |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
150 |
public void sendPresencePacket(PresenceAdapter presence) throws RemoteException { |
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
151 |
initConnection(); |
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
152 |
Presence presence2 = new Presence(PresenceType.getPresenceTypeFrom(presence.getType())); |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
153 |
presence2.setTo(presence.getTo()); |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
154 |
mConnexion.getAdaptee().sendPacket(presence2); |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
155 |
} |
38
3e76846c48a9
We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff
changeset
|
156 |
|
934
6b30719f4de6
merge otr repo with trunk
Nikita Kozlov <nikita@elyzion.net>
parents:
929
diff
changeset
|
157 |
/* (non-Javadoc) |
567 | 158 |
* @see com.beem.project.beem.service.aidl.IXmppFacade#call(java.lang.String) |
159 |
*/ |
|
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
160 |
@Override |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
161 |
public void call(String jid) throws RemoteException { |
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
162 |
} |
57
c91278dda166
La facade et la connexion permette de recuperer une instance de ChatManager
Da Risk <darisk972@gmail.com>
parents:
55
diff
changeset
|
163 |
|
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
164 |
@Override |
870
d23d8ad3b9ba
Add a basic way to publish avatar.
Da Risk <darisk972@gmail.com>
parents:
809
diff
changeset
|
165 |
public boolean publishAvatar(Uri avatarUri) throws RemoteException { |
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
166 |
initConnection(); |
870
d23d8ad3b9ba
Add a basic way to publish avatar.
Da Risk <darisk972@gmail.com>
parents:
809
diff
changeset
|
167 |
BeemAvatarManager mgr = mConnexion.getAvatarManager(); |
808
98d220b7fe9d
Add a way to display the avatar of a contact.
Da Risk <darisk972@gmail.com>
parents:
671
diff
changeset
|
168 |
if (mgr == null) |
870
d23d8ad3b9ba
Add a basic way to publish avatar.
Da Risk <darisk972@gmail.com>
parents:
809
diff
changeset
|
169 |
return false; |
d23d8ad3b9ba
Add a basic way to publish avatar.
Da Risk <darisk972@gmail.com>
parents:
809
diff
changeset
|
170 |
|
d23d8ad3b9ba
Add a basic way to publish avatar.
Da Risk <darisk972@gmail.com>
parents:
809
diff
changeset
|
171 |
return mgr.publishAvatar(avatarUri); |
d23d8ad3b9ba
Add a basic way to publish avatar.
Da Risk <darisk972@gmail.com>
parents:
809
diff
changeset
|
172 |
} |
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
173 |
|
870
d23d8ad3b9ba
Add a basic way to publish avatar.
Da Risk <darisk972@gmail.com>
parents:
809
diff
changeset
|
174 |
@Override |
d23d8ad3b9ba
Add a basic way to publish avatar.
Da Risk <darisk972@gmail.com>
parents:
809
diff
changeset
|
175 |
public void disableAvatarPublishing() throws RemoteException { |
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
176 |
initConnection(); |
870
d23d8ad3b9ba
Add a basic way to publish avatar.
Da Risk <darisk972@gmail.com>
parents:
809
diff
changeset
|
177 |
BeemAvatarManager mgr = mConnexion.getAvatarManager(); |
d23d8ad3b9ba
Add a basic way to publish avatar.
Da Risk <darisk972@gmail.com>
parents:
809
diff
changeset
|
178 |
if (mgr != null) |
d23d8ad3b9ba
Add a basic way to publish avatar.
Da Risk <darisk972@gmail.com>
parents:
809
diff
changeset
|
179 |
mgr.disableAvatarPublishing(); |
503
93e5d2d9953f
Le formatter a encore frappé.
Jean-Manuel ¨dasilvj¨ Da Silva
parents:
502
diff
changeset
|
180 |
} |
871
0ceee1f2b829
Show current avatar in ChangeStatus.
Da Risk <darisk972@gmail.com>
parents:
870
diff
changeset
|
181 |
|
0ceee1f2b829
Show current avatar in ChangeStatus.
Da Risk <darisk972@gmail.com>
parents:
870
diff
changeset
|
182 |
@Override |
0ceee1f2b829
Show current avatar in ChangeStatus.
Da Risk <darisk972@gmail.com>
parents:
870
diff
changeset
|
183 |
public UserInfo getUserInfo() throws RemoteException { |
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
184 |
initConnection(); |
871
0ceee1f2b829
Show current avatar in ChangeStatus.
Da Risk <darisk972@gmail.com>
parents:
870
diff
changeset
|
185 |
return mConnexion.getUserInfo(); |
0ceee1f2b829
Show current avatar in ChangeStatus.
Da Risk <darisk972@gmail.com>
parents:
870
diff
changeset
|
186 |
} |
964
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
187 |
|
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
188 |
/** |
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
189 |
* Initialize the connection. |
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
190 |
*/ |
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
191 |
private void initConnection() { |
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
192 |
if (mConnexion == null) { |
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
193 |
mConnexion = service.createConnection(); |
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
194 |
} |
89dbb4bee206
Initialize the xmpp connection config in a background thread.
Da Risk <da_risk@beem-project.com>
parents:
934
diff
changeset
|
195 |
} |
38
3e76846c48a9
We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff
changeset
|
196 |
} |