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

View file

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