Merge https://github.com/siacs/Conversations into development
This commit is contained in:
commit
b8023b4dfc
|
@ -1,8 +0,0 @@
|
||||||
<resources>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Customize dimensions originally defined in res/values/dimens.xml (such as
|
|
||||||
screen margins) for sw600dp devices (e.g. 7" tablets) here.
|
|
||||||
-->
|
|
||||||
|
|
||||||
</resources>
|
|
|
@ -1,9 +0,0 @@
|
||||||
<resources>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Customize dimensions originally defined in res/values/dimens.xml (such as
|
|
||||||
screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
|
|
||||||
-->
|
|
||||||
<dimen name="activity_horizontal_margin">128dp</dimen>
|
|
||||||
|
|
||||||
</resources>
|
|
|
@ -1,11 +0,0 @@
|
||||||
<resources>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Base application theme for API 11+. This theme completely replaces
|
|
||||||
AppBaseTheme from res/values/styles.xml on API 11+ devices.
|
|
||||||
-->
|
|
||||||
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
|
|
||||||
<!-- API 11 theme customizations can go here. -->
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</resources>
|
|
|
@ -1,12 +0,0 @@
|
||||||
<resources>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Base application theme for API 14+. This theme completely replaces
|
|
||||||
AppBaseTheme from BOTH res/values/styles.xml and
|
|
||||||
res/values-v11/styles.xml on API 14+ devices.
|
|
||||||
-->
|
|
||||||
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
|
|
||||||
<!-- API 14 theme customizations can go here. -->
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</resources>
|
|
|
@ -1,7 +0,0 @@
|
||||||
<resources>
|
|
||||||
|
|
||||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
|
||||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
|
||||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
|
||||||
|
|
||||||
</resources>
|
|
|
@ -80,7 +80,7 @@
|
||||||
<string name="send_unencrypted">Send unencrypted</string>
|
<string name="send_unencrypted">Send unencrypted</string>
|
||||||
<string name="decryption_failed">Decrpytion failed. Maybe you don’t have the proper private key.</string>
|
<string name="decryption_failed">Decrpytion failed. Maybe you don’t have the proper private key.</string>
|
||||||
<string name="openkeychain_required">OpenKeychain</string>
|
<string name="openkeychain_required">OpenKeychain</string>
|
||||||
<string name="openkeychain_required_long">Conversations utilizes a third party called <b>OpenKeychain</b> to encrypt and decrypt messages and to mange your public keys.\n\nOpenKeychain is licensed under GPLv3 and available on F-Droid and Google Play.\n\nTo use openPGP please install the app and then restart Conversations.</string>
|
<string name="openkeychain_required_long">Conversations utilizes a third party app called <b>OpenKeychain</b> to encrypt and decrypt messages and to mange your public keys.\n\nOpenKeychain is licensed under GPLv3 and available on F-Droid and Google Play.\n\n<small>(Please restart Conversations afterwards.)</small></string>
|
||||||
<string name="restart">Restart</string>
|
<string name="restart">Restart</string>
|
||||||
<string name="install">Install</string>
|
<string name="install">Install</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1,23 +1,5 @@
|
||||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<!--
|
|
||||||
Base application theme, dependent on API level. This theme is replaced
|
|
||||||
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
|
|
||||||
-->
|
|
||||||
<style name="AppBaseTheme" parent="android:Theme.Light">
|
|
||||||
<!--
|
|
||||||
Theme customizations available in newer API levels can go in
|
|
||||||
res/values-vXX/styles.xml, while customizations related to
|
|
||||||
backward-compatibility can go here.
|
|
||||||
-->
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<!-- Application theme. -->
|
|
||||||
<style name="AppTheme" parent="AppBaseTheme">
|
|
||||||
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
|
|
||||||
</style>
|
|
||||||
|
|
||||||
|
|
||||||
<style name="sectionHeader" parent="android:Widget.Holo.Light.TextView">
|
<style name="sectionHeader" parent="android:Widget.Holo.Light.TextView">
|
||||||
<item name="android:drawableBottom">@drawable/section_header</item>
|
<item name="android:drawableBottom">@drawable/section_header</item>
|
||||||
<item name="android:drawablePadding">4dp</item>
|
<item name="android:drawablePadding">4dp</item>
|
||||||
|
|
|
@ -377,12 +377,14 @@ public class XmppConnectionService extends Service {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onIqPacketReceived(Account account, IqPacket packet) {
|
public void onIqPacketReceived(Account account, IqPacket packet) {
|
||||||
if (packet.hasChild("query")) {
|
if (packet.hasChild("query","jabber:iq:roster")) {
|
||||||
|
String from = packet.getFrom();
|
||||||
|
if ((from==null)||(from.equals(account.getJid()))) {
|
||||||
Element query = packet.findChild("query");
|
Element query = packet.findChild("query");
|
||||||
String xmlns = query.getAttribute("xmlns");
|
|
||||||
if ((xmlns != null) && (xmlns.equals("jabber:iq:roster"))) {
|
|
||||||
processRosterItems(account, query);
|
processRosterItems(account, query);
|
||||||
mergePhoneContactsWithRoster(null);
|
mergePhoneContactsWithRoster(null);
|
||||||
|
} else {
|
||||||
|
Log.d(LOGTAG,"unauthorized roster push from: "+from);
|
||||||
}
|
}
|
||||||
} else if (packet
|
} else if (packet
|
||||||
.hasChild("open", "http://jabber.org/protocol/ibb")
|
.hasChild("open", "http://jabber.org/protocol/ibb")
|
||||||
|
@ -390,8 +392,22 @@ public class XmppConnectionService extends Service {
|
||||||
.hasChild("data", "http://jabber.org/protocol/ibb")) {
|
.hasChild("data", "http://jabber.org/protocol/ibb")) {
|
||||||
XmppConnectionService.this.mJingleConnectionManager
|
XmppConnectionService.this.mJingleConnectionManager
|
||||||
.deliverIbbPacket(account, packet);
|
.deliverIbbPacket(account, packet);
|
||||||
|
} else if (packet.hasChild("query","http://jabber.org/protocol/disco#info")) {
|
||||||
|
IqPacket iqResponse = packet.generateRespone(IqPacket.TYPE_RESULT);
|
||||||
|
Element query = iqResponse.addChild("query", "http://jabber.org/protocol/disco#info");
|
||||||
|
query.addChild("feature").setAttribute("var", "urn:xmpp:jingle:1");
|
||||||
|
query.addChild("feature").setAttribute("var", "urn:xmpp:jingle:apps:file-transfer:3");
|
||||||
|
query.addChild("feature").setAttribute("var", "urn:xmpp:jingle:transports:s5b:1");
|
||||||
|
query.addChild("feature").setAttribute("var", "urn:xmpp:jingle:transports:ibb:1");
|
||||||
|
account.getXmppConnection().sendIqPacket(iqResponse, null);
|
||||||
} else {
|
} else {
|
||||||
Log.d(LOGTAG, "iq packet arrived " + packet.toString());
|
if ((packet.getType() == IqPacket.TYPE_GET)||(packet.getType() == IqPacket.TYPE_SET)) {
|
||||||
|
IqPacket response = packet.generateRespone(IqPacket.TYPE_ERROR);
|
||||||
|
Element error = response.addChild("error");
|
||||||
|
error.setAttribute("type","cancel");
|
||||||
|
error.addChild("feature-not-implemented","urn:ietf:params:xml:ns:xmpp-stanzas");
|
||||||
|
account.getXmppConnection().sendIqPacket(response, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -619,6 +635,7 @@ public class XmppConnectionService extends Service {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
|
Log.d(LOGTAG,"stopping service");
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
for (Account account : accounts) {
|
for (Account account : accounts) {
|
||||||
if (account.getXmppConnection() != null) {
|
if (account.getXmppConnection() != null) {
|
||||||
|
|
|
@ -95,8 +95,12 @@ public abstract class XmppActivity extends Activity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
// TODO Auto-generated method stub
|
if (xmppConnectionServiceBound) {
|
||||||
|
unbindService(mConnection);
|
||||||
|
xmppConnectionServiceBound = false;
|
||||||
|
}
|
||||||
|
stopService(new Intent(XmppActivity.this, XmppConnectionService.class));
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
builder.setPositiveButton(getString(R.string.install), new OnClickListener() {
|
builder.setPositiveButton(getString(R.string.install), new OnClickListener() {
|
||||||
|
@ -106,6 +110,7 @@ public abstract class XmppActivity extends Activity {
|
||||||
Uri uri = Uri.parse("market://details?id=org.sufficientlysecure.keychain");
|
Uri uri = Uri.parse("market://details?id=org.sufficientlysecure.keychain");
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
builder.create().show();
|
builder.create().show();
|
||||||
|
|
|
@ -52,6 +52,9 @@ public class JingleConnection {
|
||||||
private Element fileOffer;
|
private Element fileOffer;
|
||||||
private JingleFile file = null;
|
private JingleFile file = null;
|
||||||
|
|
||||||
|
private String contentName;
|
||||||
|
private String contentCreator;
|
||||||
|
|
||||||
private boolean receivedCandidate = false;
|
private boolean receivedCandidate = false;
|
||||||
private boolean sentCandidate = false;
|
private boolean sentCandidate = false;
|
||||||
|
|
||||||
|
@ -160,6 +163,8 @@ public class JingleConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init(Message message) {
|
public void init(Message message) {
|
||||||
|
this.contentCreator = "initiator";
|
||||||
|
this.contentName = this.mJingleConnectionManager.nextRandomId();
|
||||||
this.message = message;
|
this.message = message;
|
||||||
this.account = message.getConversation().getAccount();
|
this.account = message.getConversation().getAccount();
|
||||||
this.initiator = this.account.getFullJid();
|
this.initiator = this.account.getFullJid();
|
||||||
|
@ -215,6 +220,8 @@ public class JingleConnection {
|
||||||
this.responder = this.account.getFullJid();
|
this.responder = this.account.getFullJid();
|
||||||
this.sessionId = packet.getSessionId();
|
this.sessionId = packet.getSessionId();
|
||||||
Content content = packet.getJingleContent();
|
Content content = packet.getJingleContent();
|
||||||
|
this.contentCreator = content.getAttribute("creator");
|
||||||
|
this.contentName = content.getAttribute("name");
|
||||||
this.transportId = content.getTransportId();
|
this.transportId = content.getTransportId();
|
||||||
this.mergeCandidates(JingleCandidate.parse(content.socks5transport().getChildren()));
|
this.mergeCandidates(JingleCandidate.parse(content.socks5transport().getChildren()));
|
||||||
this.fileOffer = packet.getJingleContent().getFileOffer();
|
this.fileOffer = packet.getJingleContent().getFileOffer();
|
||||||
|
@ -263,10 +270,8 @@ public class JingleConnection {
|
||||||
|
|
||||||
private void sendInitRequest() {
|
private void sendInitRequest() {
|
||||||
JinglePacket packet = this.bootstrapPacket("session-initiate");
|
JinglePacket packet = this.bootstrapPacket("session-initiate");
|
||||||
Content content = new Content();
|
Content content = new Content(this.contentCreator,this.contentName);
|
||||||
if (message.getType() == Message.TYPE_IMAGE) {
|
if (message.getType() == Message.TYPE_IMAGE) {
|
||||||
content.setAttribute("creator", "initiator");
|
|
||||||
content.setAttribute("name", "a-file-offer");
|
|
||||||
content.setTransportId(this.transportId);
|
content.setTransportId(this.transportId);
|
||||||
this.file = this.mXmppConnectionService.getFileBackend().getJingleFile(message);
|
this.file = this.mXmppConnectionService.getFileBackend().getJingleFile(message);
|
||||||
content.setFileOffer(this.file);
|
content.setFileOffer(this.file);
|
||||||
|
@ -295,7 +300,7 @@ public class JingleConnection {
|
||||||
@Override
|
@Override
|
||||||
public void onPrimaryCandidateFound(boolean success,final JingleCandidate candidate) {
|
public void onPrimaryCandidateFound(boolean success,final JingleCandidate candidate) {
|
||||||
final JinglePacket packet = bootstrapPacket("session-accept");
|
final JinglePacket packet = bootstrapPacket("session-accept");
|
||||||
final Content content = new Content();
|
final Content content = new Content(contentCreator,contentName);
|
||||||
content.setFileOffer(fileOffer);
|
content.setFileOffer(fileOffer);
|
||||||
content.setTransportId(transportId);
|
content.setTransportId(transportId);
|
||||||
if ((success)&&(!equalCandidateExists(candidate))) {
|
if ((success)&&(!equalCandidateExists(candidate))) {
|
||||||
|
@ -499,7 +504,7 @@ public class JingleConnection {
|
||||||
|
|
||||||
private void sendFallbackToIbb() {
|
private void sendFallbackToIbb() {
|
||||||
JinglePacket packet = this.bootstrapPacket("transport-replace");
|
JinglePacket packet = this.bootstrapPacket("transport-replace");
|
||||||
Content content = new Content("initiator","a-file-offer");
|
Content content = new Content(this.contentCreator,this.contentName);
|
||||||
this.transportId = this.mJingleConnectionManager.nextRandomId();
|
this.transportId = this.mJingleConnectionManager.nextRandomId();
|
||||||
content.setTransportId(this.transportId);
|
content.setTransportId(this.transportId);
|
||||||
content.ibbTransport().setAttribute("block-size",""+this.ibbBlockSize);
|
content.ibbTransport().setAttribute("block-size",""+this.ibbBlockSize);
|
||||||
|
@ -613,7 +618,7 @@ public class JingleConnection {
|
||||||
|
|
||||||
private void sendProxyActivated(String cid) {
|
private void sendProxyActivated(String cid) {
|
||||||
JinglePacket packet = bootstrapPacket("transport-info");
|
JinglePacket packet = bootstrapPacket("transport-info");
|
||||||
Content content = new Content("inititaor","a-file-offer");
|
Content content = new Content(this.contentCreator,this.contentName);
|
||||||
content.setTransportId(this.transportId);
|
content.setTransportId(this.transportId);
|
||||||
content.socks5transport().addChild("activated").setAttribute("cid", cid);
|
content.socks5transport().addChild("activated").setAttribute("cid", cid);
|
||||||
packet.setContent(content);
|
packet.setContent(content);
|
||||||
|
@ -622,7 +627,7 @@ public class JingleConnection {
|
||||||
|
|
||||||
private void sendCandidateUsed(final String cid) {
|
private void sendCandidateUsed(final String cid) {
|
||||||
JinglePacket packet = bootstrapPacket("transport-info");
|
JinglePacket packet = bootstrapPacket("transport-info");
|
||||||
Content content = new Content("initiator","a-file-offer");
|
Content content = new Content(this.contentCreator,this.contentName);
|
||||||
content.setTransportId(this.transportId);
|
content.setTransportId(this.transportId);
|
||||||
content.socks5transport().addChild("candidate-used").setAttribute("cid", cid);
|
content.socks5transport().addChild("candidate-used").setAttribute("cid", cid);
|
||||||
packet.setContent(content);
|
packet.setContent(content);
|
||||||
|
@ -635,7 +640,7 @@ public class JingleConnection {
|
||||||
|
|
||||||
private void sendCandidateError() {
|
private void sendCandidateError() {
|
||||||
JinglePacket packet = bootstrapPacket("transport-info");
|
JinglePacket packet = bootstrapPacket("transport-info");
|
||||||
Content content = new Content("initiator","a-file-offer");
|
Content content = new Content(this.contentCreator,this.contentName);
|
||||||
content.setTransportId(this.transportId);
|
content.setTransportId(this.transportId);
|
||||||
content.socks5transport().addChild("candidate-error");
|
content.socks5transport().addChild("candidate-error");
|
||||||
packet.setContent(content);
|
packet.setContent(content);
|
||||||
|
|
|
@ -26,6 +26,9 @@ public class IqPacket extends AbstractStanza {
|
||||||
case TYPE_RESULT:
|
case TYPE_RESULT:
|
||||||
this.setAttribute("type", "result");
|
this.setAttribute("type", "result");
|
||||||
break;
|
break;
|
||||||
|
case TYPE_ERROR:
|
||||||
|
this.setAttribute("type", "error");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue