made shareing text with conferences possible again
This commit is contained in:
parent
b334ebd0fa
commit
d9990e6cd8
|
@ -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,37 +124,38 @@ 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() {
|
||||
Account account = xmppConnectionService.findAccountByJid(share.account);
|
||||
if (account==null) {
|
||||
if (account == null) {
|
||||
return;
|
||||
}
|
||||
Conversation conversation = xmppConnectionService.findOrCreateConversation(account, share.contact, false);
|
||||
Conversation conversation = xmppConnectionService
|
||||
.findOrCreateConversation(account, share.contact, false);
|
||||
share(conversation);
|
||||
}
|
||||
|
||||
|
@ -172,7 +176,7 @@ public class ShareWithActivity extends XmppActivity {
|
|||
});
|
||||
|
||||
} else {
|
||||
switchToConversation(conversation,this.share.text, true);
|
||||
switchToConversation(conversation, this.share.text, true);
|
||||
finish();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue