deal with null socket (e.g. if in airplane mode); deal with new public

rooms format.
This commit is contained in:
Andy2 2010-10-17 20:18:24 -07:00
parent 1621e5932a
commit 5c958eaadb

View file

@ -70,7 +70,7 @@ public class RefreshNamesTask extends AsyncTask<Void, Void, String[]> {
try {
Socket socket = NetUtils.MakeProxySocket( m_context, 15000 );
if ( null != socket ) {
DataOutputStream outStream =
new DataOutputStream( socket.getOutputStream() );
@ -101,9 +101,11 @@ public class RefreshNamesTask extends AsyncTask<Void, Void, String[]> {
}
String name = new String( bytes, lastIndex, index - lastIndex );
Utils.logf( "got public room name: %s", name );
int indx = name.lastIndexOf("/");
int indx = name.lastIndexOf( "/" );
indx = name.lastIndexOf( "/", indx-1 );
names.add( name.substring(0, indx ) );
}
}
} catch ( java.io.IOException ioe ) {
Utils.logf( "%s", ioe.toString() );
}