--- a/.classpath Sat Oct 03 12:45:25 2009 +0200
+++ b/.classpath Sat Oct 03 12:47:02 2009 +0200
@@ -13,7 +13,7 @@
</attributes>
</classpathentry>
<classpathentry kind="lib" path="libs/security.jar"/>
- <classpathentry kind="lib" path="libs/smack.jar" sourcepath="/home/nikita/devel/smack">
+ <classpathentry kind="lib" path="libs/smack.jar" sourcepath="/home/marseille/smack_src_3_1_0/source">
<attributes>
<attribute name="javadoc_location" value="file:/home/nikita/devel/smack_src_3_1_0/javadoc/org/"/>
</attributes>
--- a/src/com/beem/project/beem/jingle/demo/JingleCallActivity.java Sat Oct 03 12:45:25 2009 +0200
+++ b/src/com/beem/project/beem/jingle/demo/JingleCallActivity.java Sat Oct 03 12:47:02 2009 +0200
@@ -3,6 +3,7 @@
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
+import org.jivesoftware.smack.ConnectionConfiguration.SecurityMode;
import org.jivesoftware.smack.util.StringUtils;
import android.app.Activity;
@@ -40,11 +41,12 @@
@Override
protected void onCreate(Bundle savedInstanceState) {
- // TODO Auto-generated method stub
+ java.security.Security.addProvider(new com.sun.security.sasl.Provider());
super.onCreate(savedInstanceState);
setContentView(R.layout.jingle_call_activity);
- // localhost
- mConf = new ConnectionConfiguration("10.0.2.2", 5222);
+ // localhost mConf = new ConnectionConfiguration("10.0.2.2", 5222);
+ mConf = new ConnectionConfiguration("elyzion.net", 5222);
+ mConf.setSecurityMode(SecurityMode.required);
mEdJID = (EditText) findViewById(R.id.jingledemocalljid);
mEdPassword = (EditText) findViewById(R.id.jingledemocallpassword);
mEdReceiver = (EditText) findViewById(R.id.jingledemocallreceiver);
@@ -59,6 +61,7 @@
String password = mEdPassword.getText().toString();
try {
mConnection.connect();
+ Thread.sleep(3000);
mConnection.login(login, password);
mJingle = new JingleService(mConnection);
mJingle.initWhenConntected(mConnection);
@@ -67,7 +70,10 @@
} catch (XMPPException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- }
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
}
});
--- a/src/com/beem/project/beem/ui/ContactList.java Sat Oct 03 12:45:25 2009 +0200
+++ b/src/com/beem/project/beem/ui/ContactList.java Sat Oct 03 12:47:02 2009 +0200
@@ -352,8 +352,22 @@
@Override
public void onEntriesAdded(List<String> addresses) throws RemoteException {
for (String newName : addresses) {
- Contact c = new Contact(newName);
- mListContact.add(c);
+ Contact c = mRoster.getContact(newName);
+ mContactOnGroup.get(getString(R.string.contact_list_all_contact)).add(c);
+ if (c.getGroups().size() == 0)
+ mContactOnGroup.get(getString(R.string.contact_list_no_group)).add(c);
+ else {
+ for (String group : c.getGroups()) {
+ if (!mListGroup.contains(group)) {
+ mListGroup.add(mListGroup.size() - 1, group);
+ List<Contact> tmplist = new ArrayList<Contact>();
+ mContactOnGroup.put(group, tmplist);
+ }
+ mContactOnGroup.get(group).add(c);
+ if (group.equals(mCurGroup))
+ mListContact.add(c);
+ }
+ }
}
mHandler.post(new RunnableChange());
}
@@ -367,6 +381,13 @@
for (Contact c : mListContact) {
if (c.getJID().equals(cToDelete)) {
mListContact.remove(c);
+ for (String group : mListGroup) {
+ mContactOnGroup.get(group).remove(c);
+ if (mContactOnGroup.get(group).size() == 0) {
+ mListGroup.remove(group);
+ mListContact = mContactOnGroup.get(getString(R.string.contact_list_all_contact));
+ }
+ }
break;
}
}
@@ -529,7 +550,7 @@
break;
default:
imageDrawable = getResources().getDrawable(R.drawable.error);
- break;
+ break;
}
imgV.setImageDrawable(imageDrawable);
@@ -553,12 +574,12 @@
* getResources().getDrawable(R.drawable.avatar); imgV.setImageDrawable(imageDrawable); }
*/
- if (false){
+ if (false) {
imgV = (ImageView) view.findViewById(R.id.contactlistavatar);
byte[] rawImg;
try {
- //TODO: le faire en asynchrone, car la ca bloque tout.
+ // TODO: le faire en asynchrone, car la ca bloque tout.
rawImg = mXmppFacade.getVcardAvatar(curContact.getJID());
if (rawImg != null)
imgV.setImageBitmap(BitmapFactory.decodeByteArray(rawImg, 0, rawImg.length));