Skip to content

Commit 7bdd909

Browse files
author
Grigory Fedorov
committed
Merge branch 'release/1.0.74'
2 parents 94bc267 + ab8bedd commit 7bdd909

File tree

5 files changed

+27
-9
lines changed

5 files changed

+27
-9
lines changed

xabber/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
defaultConfig {
88
minSdkVersion 14
99
targetSdkVersion 23
10-
versionCode 246
11-
versionName '1.0.73'
10+
versionCode 247
11+
versionName '1.0.74'
1212
}
1313

1414
compileOptions {

xabber/src/main/java/com/xabber/android/data/account/AccountManager.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,10 @@ public void updateAccount(String account, boolean custom, String host, int port,
502502
AccountItem result;
503503
AccountItem accountItem = getAccount(account);
504504

505+
if (accountItem == null) {
506+
return;
507+
}
508+
505509
if (accountItem.getConnectionSettings().getServerName().equals(serverName)
506510
&& accountItem.getConnectionSettings().getUserName().equals(userName)
507511
&& accountItem.getConnectionSettings().getResource().equals(resource)) {

xabber/src/main/java/com/xabber/android/data/extension/csi/ClientStateManager.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.xabber.android.data.account.AccountManager;
55
import com.xabber.android.data.connection.ConnectionThread;
66

7+
import org.jivesoftware.smack.AbstractXMPPConnection;
78
import org.jivesoftware.smack.SmackException;
89
import org.jivesoftware.smack.XMPPConnection;
910
import org.jivesoftware.smack.packet.PlainStreamElement;
@@ -31,16 +32,22 @@ protected static void sendClientState(PlainStreamElement element) {
3132
AccountManager accountManager = AccountManager.getInstance();
3233
for (String accountName : accountManager.getAccounts()) {
3334
AccountItem account = accountManager.getAccount(accountName);
34-
if (account == null)
35+
if (account == null) {
3536
continue;
37+
}
3638
ConnectionThread connectionThread = account.getConnectionThread();
37-
if (connectionThread == null)
39+
if (connectionThread == null) {
3840
continue;
41+
}
3942

40-
XMPPConnection stream = connectionThread.getXMPPConnection();
41-
if (stream.hasFeature("csi", ClientStateIndication.NAMESPACE))
43+
AbstractXMPPConnection xmppConnection = connectionThread.getXMPPConnection();
44+
if (xmppConnection == null) {
45+
continue;
46+
}
47+
48+
if (xmppConnection.hasFeature("csi", ClientStateIndication.NAMESPACE))
4249
try {
43-
stream.send(element);
50+
xmppConnection.send(element);
4451
} catch (SmackException.NotConnectedException e) {
4552
// not connected
4653
}

xabber/src/main/java/com/xabber/android/ui/preferences/AccountEditorFragment.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.app.Activity;
44
import android.os.Bundle;
55
import android.preference.Preference;
6+
import android.support.annotation.Nullable;
67
import android.widget.Toast;
78

89
import com.xabber.android.R;
@@ -20,11 +21,17 @@
2021

2122
public class AccountEditorFragment extends BaseSettingsFragment {
2223

24+
@Nullable
2325
private AccountEditorFragmentInteractionListener mListener;
2426

2527
@Override
2628
protected void onInflate(Bundle savedInstanceState) {
27-
AccountProtocol protocol = mListener.getAccountItem().getConnectionSettings().getProtocol();
29+
AccountProtocol protocol;
30+
if (mListener == null) {
31+
return;
32+
}
33+
34+
protocol = mListener.getAccountItem().getConnectionSettings().getProtocol();
2835
if (protocol == AccountProtocol.xmpp) {
2936
addPreferencesFromResource(R.xml.account_editor_xmpp);
3037
} else if (protocol == AccountProtocol.gtalk) {

xabber/src/main/res/layout-ldrtl/contact_list_item_second_line.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
android:layout_width="wrap_content"
3838
android:layout_height="wrap_content"
3939
android:src="@drawable/ic_show_offline_small"
40-
android:tint="?attr/contact_list_contact_small_right_icon_alpha"
40+
android:alpha="?attr/contact_list_contact_small_right_icon_alpha"
4141
android:layout_toLeftOf="@id/small_right_text"
4242
android:layout_alignBottom="@id/second_line_message"
4343
android:layout_marginBottom="2dp" />

0 commit comments

Comments
 (0)