Skip to content

Commit

Permalink
Merge branch 'release/1.0.74'
Browse files Browse the repository at this point in the history
  • Loading branch information
Grigory Fedorov committed Dec 28, 2015
2 parents 94bc267 + ab8bedd commit 7bdd909
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
4 changes: 2 additions & 2 deletions xabber/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 246
versionName '1.0.73'
versionCode 247
versionName '1.0.74'
}

compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,10 @@ public void updateAccount(String account, boolean custom, String host, int port,
AccountItem result;
AccountItem accountItem = getAccount(account);

if (accountItem == null) {
return;
}

if (accountItem.getConnectionSettings().getServerName().equals(serverName)
&& accountItem.getConnectionSettings().getUserName().equals(userName)
&& accountItem.getConnectionSettings().getResource().equals(resource)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.xabber.android.data.account.AccountManager;
import com.xabber.android.data.connection.ConnectionThread;

import org.jivesoftware.smack.AbstractXMPPConnection;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.packet.PlainStreamElement;
Expand Down Expand Up @@ -31,16 +32,22 @@ protected static void sendClientState(PlainStreamElement element) {
AccountManager accountManager = AccountManager.getInstance();
for (String accountName : accountManager.getAccounts()) {
AccountItem account = accountManager.getAccount(accountName);
if (account == null)
if (account == null) {
continue;
}
ConnectionThread connectionThread = account.getConnectionThread();
if (connectionThread == null)
if (connectionThread == null) {
continue;
}

XMPPConnection stream = connectionThread.getXMPPConnection();
if (stream.hasFeature("csi", ClientStateIndication.NAMESPACE))
AbstractXMPPConnection xmppConnection = connectionThread.getXMPPConnection();
if (xmppConnection == null) {
continue;
}

if (xmppConnection.hasFeature("csi", ClientStateIndication.NAMESPACE))
try {
stream.send(element);
xmppConnection.send(element);
} catch (SmackException.NotConnectedException e) {
// not connected
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.app.Activity;
import android.os.Bundle;
import android.preference.Preference;
import android.support.annotation.Nullable;
import android.widget.Toast;

import com.xabber.android.R;
Expand All @@ -20,11 +21,17 @@

public class AccountEditorFragment extends BaseSettingsFragment {

@Nullable
private AccountEditorFragmentInteractionListener mListener;

@Override
protected void onInflate(Bundle savedInstanceState) {
AccountProtocol protocol = mListener.getAccountItem().getConnectionSettings().getProtocol();
AccountProtocol protocol;
if (mListener == null) {
return;
}

protocol = mListener.getAccountItem().getConnectionSettings().getProtocol();
if (protocol == AccountProtocol.xmpp) {
addPreferencesFromResource(R.xml.account_editor_xmpp);
} else if (protocol == AccountProtocol.gtalk) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_show_offline_small"
android:tint="?attr/contact_list_contact_small_right_icon_alpha"
android:alpha="?attr/contact_list_contact_small_right_icon_alpha"
android:layout_toLeftOf="@id/small_right_text"
android:layout_alignBottom="@id/second_line_message"
android:layout_marginBottom="2dp" />
Expand Down

0 comments on commit 7bdd909

Please sign in to comment.