made shareing text with conferences possible again

This commit is contained in:
iNPUTmice 2014-09-07 13:01:09 +02:00
parent b334ebd0fa
commit d9990e6cd8
1 changed files with 28 additions and 24 deletions

View File

@ -64,9 +64,11 @@ public class ShareWithActivity extends XmppActivity {
&& resultCode == RESULT_OK) {
share.contact = data.getStringExtra("contact");
share.account = data.getStringExtra("account");
Log.d(Config.LOGTAG,"contact: "+share.contact+" account:"+share.account);
Log.d(Config.LOGTAG, "contact: " + share.contact + " account:"
+ share.account);
}
if (xmppConnectionServiceBound && share != null && share.contact != null && share.account != null) {
if (xmppConnectionServiceBound && share != null
&& share.contact != null && share.account != null) {
share();
}
}
@ -92,7 +94,8 @@ public class ShareWithActivity extends XmppActivity {
public void onItemClick(AdapterView<?> arg0, View arg1,
int position, long arg3) {
Conversation conversation = mConversations.get(position);
if (conversation.getMode() == Conversation.MODE_SINGLE) {
if (conversation.getMode() == Conversation.MODE_SINGLE
|| share.uri == null) {
share(mConversations.get(position));
}
}
@ -121,29 +124,29 @@ public class ShareWithActivity extends XmppActivity {
@Override
public void onStart() {
super.onStart();
if (getIntent().getType() != null && getIntent().getType()
.startsWith("image/")) {
if (getIntent().getType() != null
&& getIntent().getType().startsWith("image/")) {
this.share.uri = (Uri) getIntent().getParcelableExtra(
Intent.EXTRA_STREAM);
} else {
this.share.text = getIntent().getStringExtra(Intent.EXTRA_TEXT);
}
if (xmppConnectionServiceBound) {
xmppConnectionService.populateWithOrderedConversations(
mConversations, this.share.uri == null);
}
super.onStart();
}
@Override
void onBackendConnected() {
if (xmppConnectionServiceBound && share != null && share.contact != null && share.account != null) {
if (xmppConnectionServiceBound && share != null
&& share.contact != null && share.account != null) {
share();
return;
}
xmppConnectionService.populateWithOrderedConversations(mConversations,
false);
for (Conversation conversation : mConversations) {
if (conversation.getMode() == Conversation.MODE_MULTI) {
mConversations.remove(conversation);
}
}
this.share != null && this.share.uri == null);
}
private void share() {
@ -151,7 +154,8 @@ public class ShareWithActivity extends XmppActivity {
if (account == null) {
return;
}
Conversation conversation = xmppConnectionService.findOrCreateConversation(account, share.contact, false);
Conversation conversation = xmppConnectionService
.findOrCreateConversation(account, share.contact, false);
share(conversation);
}