finally fixed #notificationgate
This commit is contained in:
parent
38efb84690
commit
e8290d52b1
|
@ -85,6 +85,7 @@ public class XmppConnectionService extends Service {
|
||||||
private List<Conversation> conversations = null;
|
private List<Conversation> conversations = null;
|
||||||
|
|
||||||
public OnConversationListChangedListener convChangedListener = null;
|
public OnConversationListChangedListener convChangedListener = null;
|
||||||
|
private int convChangedListenerCount = 0;
|
||||||
private OnAccountListChangedListener accountChangedListener = null;
|
private OnAccountListChangedListener accountChangedListener = null;
|
||||||
private OnTLSExceptionReceived tlsException = null;
|
private OnTLSExceptionReceived tlsException = null;
|
||||||
|
|
||||||
|
@ -1009,11 +1010,17 @@ public class XmppConnectionService extends Service {
|
||||||
public void setOnConversationListChangedListener(
|
public void setOnConversationListChangedListener(
|
||||||
OnConversationListChangedListener listener) {
|
OnConversationListChangedListener listener) {
|
||||||
this.convChangedListener = listener;
|
this.convChangedListener = listener;
|
||||||
|
this.convChangedListenerCount++;
|
||||||
|
Log.d(LOGTAG,"registered on conv changed in backend ("+convChangedListenerCount+")");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeOnConversationListChangedListener() {
|
public void removeOnConversationListChangedListener() {
|
||||||
|
this.convChangedListenerCount--;
|
||||||
|
Log.d(LOGTAG,"someone on conv changed listener removed listener ("+convChangedListenerCount+")");
|
||||||
|
if (this.convChangedListenerCount==0) {
|
||||||
this.convChangedListener = null;
|
this.convChangedListener = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setOnAccountListChangedListener(
|
public void setOnAccountListChangedListener(
|
||||||
OnAccountListChangedListener listener) {
|
OnAccountListChangedListener listener) {
|
||||||
|
|
|
@ -417,7 +417,6 @@ public class ConversationActivity extends XmppActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
void onBackendConnected() {
|
void onBackendConnected() {
|
||||||
|
|
||||||
this.registerListener();
|
this.registerListener();
|
||||||
if (conversationList.size()==0) {
|
if (conversationList.size()==0) {
|
||||||
updateConversationList();
|
updateConversationList();
|
||||||
|
|
|
@ -334,14 +334,7 @@ public class ConversationFragment extends Fragment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
activity.registerListener();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onBackendConnected() {
|
public void onBackendConnected() {
|
||||||
activity.registerListener();
|
|
||||||
this.conversation = activity.getSelectedConversation();
|
this.conversation = activity.getSelectedConversation();
|
||||||
if (this.conversation == null) {
|
if (this.conversation == null) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue