Merge tag '2.5.12' into develop
This commit is contained in:
commit
72be751568
|
@ -1,5 +1,9 @@
|
|||
# Changelog
|
||||
|
||||
### Version 2.5.12
|
||||
* Jingle file transfer fixes
|
||||
* Fixed OMEMO self healing (after backup restore) on servers w/o MAM
|
||||
|
||||
### Version 2.5.11
|
||||
* Fixed crash on Android <5.0
|
||||
|
||||
|
|
|
@ -84,8 +84,8 @@ android {
|
|||
defaultConfig {
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 25
|
||||
versionCode 342
|
||||
versionName "2.5.11.1"
|
||||
versionCode 346
|
||||
versionName "2.5.12"
|
||||
archivesBaseName += "-$versionName"
|
||||
applicationId "eu.sum7.conversations"
|
||||
resValue "string", "applicationId", applicationId
|
||||
|
|
|
@ -41,7 +41,7 @@ public final class Config {
|
|||
public static final String MAGIC_CREATE_DOMAIN = "chat.sum7.eu";
|
||||
public static final String QUICKSY_DOMAIN = "quicksy.im";
|
||||
|
||||
public static final String CHANNEL_DISCOVERY = "https://search.jabbercat.org";
|
||||
public static final String CHANNEL_DISCOVERY = "https://search.jabber.network";
|
||||
|
||||
public static final boolean DISALLOW_REGISTRATION_IN_UI = false; //hide the register checkbox
|
||||
|
||||
|
@ -99,6 +99,7 @@ public final class Config {
|
|||
public static final boolean OMEMO_PADDING = false;
|
||||
public static final boolean PUT_AUTH_TAG_INTO_KEY = true;
|
||||
|
||||
public static final boolean USE_BOOKMARKS2 = false;
|
||||
|
||||
public static final boolean DISABLE_PROXY_LOOKUP = false; //useful to debug ibb
|
||||
public static final boolean USE_DIRECT_JINGLE_CANDIDATES = true;
|
||||
|
|
|
@ -839,6 +839,13 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
|
|||
});
|
||||
}
|
||||
|
||||
public void deleteOmemoIdentity() {
|
||||
final String node = AxolotlService.PEP_BUNDLES + ":" + getOwnDeviceId();
|
||||
final IqPacket deleteBundleNode = mXmppConnectionService.getIqGenerator().deleteNode(node);
|
||||
mXmppConnectionService.sendIqPacket(account, deleteBundleNode, null);
|
||||
publishDeviceIdsAndRefineAccessModel(getOwnDeviceIds());
|
||||
}
|
||||
|
||||
public List<Jid> getCryptoTargets(Conversation conversation) {
|
||||
final List<Jid> jids;
|
||||
if (conversation.getMode() == Conversation.MODE_SINGLE) {
|
||||
|
|
|
@ -11,8 +11,10 @@ import org.json.JSONObject;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
@ -84,7 +86,7 @@ public class Account extends AbstractEntity implements AvatarService.Avatarable
|
|||
private PgpDecryptionService pgpDecryptionService = null;
|
||||
private XmppConnection xmppConnection = null;
|
||||
private long mEndGracePeriod = 0L;
|
||||
private List<Bookmark> bookmarks = new CopyOnWriteArrayList<>();
|
||||
private final Map<Jid, Bookmark> bookmarks = new HashMap<>();
|
||||
private Presence.Status presenceStatus = Presence.Status.ONLINE;
|
||||
private String presenceStatusMessage = null;
|
||||
|
||||
|
@ -469,37 +471,52 @@ public class Account extends AbstractEntity implements AvatarService.Avatarable
|
|||
return this.roster;
|
||||
}
|
||||
|
||||
public List<Bookmark> getBookmarks() {
|
||||
return this.bookmarks;
|
||||
public Collection<Bookmark> getBookmarks() {
|
||||
return this.bookmarks.values();
|
||||
}
|
||||
|
||||
public void setBookmarks(final CopyOnWriteArrayList<Bookmark> bookmarks) {
|
||||
this.bookmarks = bookmarks;
|
||||
public void setBookmarks(Map<Jid, Bookmark> bookmarks) {
|
||||
synchronized (this.bookmarks) {
|
||||
this.bookmarks.clear();
|
||||
this.bookmarks.putAll(bookmarks);
|
||||
}
|
||||
}
|
||||
|
||||
public void putBookmark(Bookmark bookmark) {
|
||||
synchronized (this.bookmarks) {
|
||||
this.bookmarks.put(bookmark.getJid(), bookmark);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeBookmark(Bookmark bookmark) {
|
||||
synchronized (this.bookmarks) {
|
||||
this.bookmarks.remove(bookmark.getJid());
|
||||
}
|
||||
}
|
||||
|
||||
public void removeBookmark(Jid jid) {
|
||||
synchronized (this.bookmarks) {
|
||||
this.bookmarks.remove(jid);
|
||||
}
|
||||
}
|
||||
|
||||
public Set<Jid> getBookmarkedJids() {
|
||||
final Set<Jid> jids = new HashSet<>();
|
||||
for(final Bookmark bookmark : this.bookmarks) {
|
||||
final Jid jid = bookmark.getJid();
|
||||
if (jid != null) {
|
||||
jids.add(jid.asBareJid());
|
||||
synchronized (this.bookmarks) {
|
||||
return new HashSet<>(this.bookmarks.keySet());
|
||||
}
|
||||
}
|
||||
return jids;
|
||||
}
|
||||
|
||||
public boolean hasBookmarkFor(final Jid conferenceJid) {
|
||||
return getBookmark(conferenceJid) != null;
|
||||
public boolean hasBookmarkFor(final Jid jid) {
|
||||
synchronized (this.bookmarks) {
|
||||
return this.bookmarks.containsKey(jid.asBareJid());
|
||||
}
|
||||
}
|
||||
|
||||
Bookmark getBookmark(final Jid jid) {
|
||||
for (final Bookmark bookmark : this.bookmarks) {
|
||||
if (bookmark.getJid() != null && jid.asBareJid().equals(bookmark.getJid().asBareJid())) {
|
||||
return bookmark;
|
||||
synchronized (this.bookmarks) {
|
||||
return this.bookmarks.get(jid.asBareJid());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean setAvatar(final String filename) {
|
||||
if (this.avatar != null && this.avatar.equals(filename)) {
|
||||
|
|
|
@ -6,12 +6,16 @@ import android.support.annotation.Nullable;
|
|||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import eu.siacs.conversations.utils.StringUtils;
|
||||
import eu.siacs.conversations.utils.UIHelper;
|
||||
import eu.siacs.conversations.xml.Element;
|
||||
import eu.siacs.conversations.xml.Namespace;
|
||||
import eu.siacs.conversations.xmpp.InvalidJid;
|
||||
import rocks.xmpp.addr.Jid;
|
||||
|
||||
|
@ -33,11 +37,69 @@ public class Bookmark extends Element implements ListItem {
|
|||
this.account = account;
|
||||
}
|
||||
|
||||
public static Map<Jid, Bookmark> parseFromStorage(Element storage, Account account) {
|
||||
if (storage == null) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
final HashMap<Jid, Bookmark> bookmarks = new HashMap<>();
|
||||
for (final Element item : storage.getChildren()) {
|
||||
if (item.getName().equals("conference")) {
|
||||
final Bookmark bookmark = Bookmark.parse(item, account);
|
||||
if (bookmark != null) {
|
||||
final Bookmark old = bookmarks.put(bookmark.jid, bookmark);
|
||||
if (old != null && old.getBookmarkName() != null && bookmark.getBookmarkName() == null) {
|
||||
bookmark.setBookmarkName(old.getBookmarkName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return bookmarks;
|
||||
}
|
||||
|
||||
public static Map<Jid, Bookmark> parseFromPubsub(Element pubsub, Account account) {
|
||||
if (pubsub == null) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
final Element items = pubsub.findChild("items");
|
||||
if (items != null && Namespace.BOOKMARKS2.equals(items.getAttribute("node"))) {
|
||||
final Map<Jid, Bookmark> bookmarks = new HashMap<>();
|
||||
for(Element item : items.getChildren()) {
|
||||
if (item.getName().equals("item")) {
|
||||
final Bookmark bookmark = Bookmark.parseFromItem(item, account);
|
||||
if (bookmark != null) {
|
||||
bookmarks.put(bookmark.jid, bookmark);
|
||||
}
|
||||
}
|
||||
}
|
||||
return bookmarks;
|
||||
}
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
public static Bookmark parse(Element element, Account account) {
|
||||
Bookmark bookmark = new Bookmark(account);
|
||||
bookmark.setAttributes(element.getAttributes());
|
||||
bookmark.setChildren(element.getChildren());
|
||||
bookmark.jid = InvalidJid.getNullForInvalid(bookmark.getAttributeAsJid("jid"));
|
||||
if (bookmark.jid == null) {
|
||||
return null;
|
||||
}
|
||||
return bookmark;
|
||||
}
|
||||
|
||||
public static Bookmark parseFromItem(Element item, Account account) {
|
||||
final Element conference = item.findChild("conference", Namespace.BOOKMARKS2);
|
||||
if (conference == null) {
|
||||
return null;
|
||||
}
|
||||
final Bookmark bookmark = new Bookmark(account);
|
||||
bookmark.jid = InvalidJid.getNullForInvalid(item.getAttributeAsJid("id"));
|
||||
if (bookmark.jid == null) {
|
||||
return null;
|
||||
}
|
||||
bookmark.setBookmarkName(conference.getAttribute("name"));
|
||||
bookmark.setAutojoin(conference.getAttributeAsBoolean("autojoin"));
|
||||
bookmark.setNick(conference.findChildContent("nick"));
|
||||
return bookmark;
|
||||
}
|
||||
|
||||
|
|
|
@ -307,8 +307,10 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
|
|||
synchronized (this.messages) {
|
||||
for (int i = this.messages.size() - 1; i >= 0; --i) {
|
||||
final Message message = messages.get(i);
|
||||
if (counterpart.equals(message.getCounterpart())
|
||||
&& ((message.getStatus() == Message.STATUS_RECEIVED) == received)
|
||||
final boolean counterpartMatch = mode == MODE_SINGLE ?
|
||||
counterpart.asBareJid().equals(message.getCounterpart().asBareJid()) :
|
||||
counterpart.equals(message.getCounterpart());
|
||||
if (counterpartMatch && ((message.getStatus() == Message.STATUS_RECEIVED) == received)
|
||||
&& (carbon == message.isCarbon() || received)) {
|
||||
final boolean idMatch = id.equals(message.getRemoteMsgId()) || message.remoteMsgIdMatchInEdit(id);
|
||||
if (idMatch && !message.isFileOrImage() && !message.treatAsDownloadable()) {
|
||||
|
|
|
@ -417,7 +417,7 @@ public class MucOptions {
|
|||
}
|
||||
}
|
||||
|
||||
private String getProposedNick() {
|
||||
public String getProposedNick() {
|
||||
final Bookmark bookmark = this.conversation.getBookmark();
|
||||
final String bookmarkedNick = normalize(account.getJid(), bookmark == null ? null : bookmark.getNick());
|
||||
if (bookmarkedNick != null) {
|
||||
|
|
|
@ -15,6 +15,7 @@ public interface Transferable {
|
|||
int STATUS_DOWNLOADING = 0x204;
|
||||
int STATUS_OFFER_CHECK_FILESIZE = 0x206;
|
||||
int STATUS_UPLOADING = 0x207;
|
||||
int STATUS_CANCELLED = 0x208;
|
||||
|
||||
|
||||
boolean start();
|
||||
|
|
|
@ -19,6 +19,7 @@ import eu.siacs.conversations.entities.Account;
|
|||
import eu.siacs.conversations.services.XmppConnectionService;
|
||||
import eu.siacs.conversations.utils.PhoneHelper;
|
||||
import eu.siacs.conversations.xml.Namespace;
|
||||
import eu.siacs.conversations.xmpp.XmppConnection;
|
||||
import eu.siacs.conversations.xmpp.jingle.stanzas.Content;
|
||||
|
||||
public abstract class AbstractGenerator {
|
||||
|
@ -38,7 +39,6 @@ public abstract class AbstractGenerator {
|
|||
"http://jabber.org/protocol/disco#info",
|
||||
"urn:xmpp:avatar:metadata+notify",
|
||||
Namespace.NICK+"+notify",
|
||||
Namespace.BOOKMARKS+"+notify",
|
||||
"urn:xmpp:ping",
|
||||
"jabber:iq:version",
|
||||
"http://jabber.org/protocol/chatstates"
|
||||
|
@ -109,7 +109,8 @@ public abstract class AbstractGenerator {
|
|||
}
|
||||
|
||||
public List<String> getFeatures(Account account) {
|
||||
ArrayList<String> features = new ArrayList<>(Arrays.asList(FEATURES));
|
||||
final XmppConnection connection = account.getXmppConnection();
|
||||
final ArrayList<String> features = new ArrayList<>(Arrays.asList(FEATURES));
|
||||
if (mXmppConnectionService.confirmMessages()) {
|
||||
features.addAll(Arrays.asList(MESSAGE_CONFIRMATION_FEATURES));
|
||||
}
|
||||
|
@ -125,6 +126,12 @@ public abstract class AbstractGenerator {
|
|||
if (mXmppConnectionService.broadcastLastActivity()) {
|
||||
features.add(Namespace.IDLE);
|
||||
}
|
||||
if (connection != null && connection.getFeatures().bookmarks2()) {
|
||||
features.add(Namespace.BOOKMARKS2 +"+notify");
|
||||
} else {
|
||||
features.add(Namespace.BOOKMARKS+"+notify");
|
||||
}
|
||||
|
||||
Collections.sort(features);
|
||||
return features;
|
||||
}
|
||||
|
|
|
@ -125,6 +125,10 @@ public class IqGenerator extends AbstractGenerator {
|
|||
return packet;
|
||||
}
|
||||
|
||||
public IqPacket retrieveBookmarks() {
|
||||
return retrieve(Namespace.BOOKMARKS2, null);
|
||||
}
|
||||
|
||||
public IqPacket publishNick(String nick) {
|
||||
final Element item = new Element("item");
|
||||
item.addChild("nick", Namespace.NICK).setContent(nick);
|
||||
|
@ -134,7 +138,17 @@ public class IqGenerator extends AbstractGenerator {
|
|||
public IqPacket deleteNode(String node) {
|
||||
IqPacket packet = new IqPacket(IqPacket.TYPE.SET);
|
||||
final Element pubsub = packet.addChild("pubsub", Namespace.PUBSUB_OWNER);
|
||||
pubsub.addChild("delete").setAttribute("node",node);
|
||||
pubsub.addChild("delete").setAttribute("node", node);
|
||||
return packet;
|
||||
}
|
||||
|
||||
public IqPacket deleteItem(final String node, final String id) {
|
||||
IqPacket packet = new IqPacket(IqPacket.TYPE.SET);
|
||||
final Element pubsub = packet.addChild("pubsub", Namespace.PUBSUB);
|
||||
final Element retract = pubsub.addChild("retract");
|
||||
retract.setAttribute("node", node);
|
||||
retract.setAttribute("notify","true");
|
||||
retract.addChild("item").setAttribute("id", id);
|
||||
return packet;
|
||||
}
|
||||
|
||||
|
@ -146,9 +160,13 @@ public class IqGenerator extends AbstractGenerator {
|
|||
return publish("urn:xmpp:avatar:data", item, options);
|
||||
}
|
||||
|
||||
public IqPacket publishElement(final String namespace,final Element element, final Bundle options) {
|
||||
public IqPacket publishElement(final String namespace, final Element element, final Bundle options) {
|
||||
return publishElement(namespace, element, "curent", options);
|
||||
}
|
||||
|
||||
public IqPacket publishElement(final String namespace, final Element element, String id, final Bundle options) {
|
||||
final Element item = new Element("item");
|
||||
item.setAttribute("id","current");
|
||||
item.setAttribute("id", id);
|
||||
item.addChild(element);
|
||||
return publish(namespace, item, options);
|
||||
}
|
||||
|
@ -222,6 +240,21 @@ public class IqGenerator extends AbstractGenerator {
|
|||
return publish(AxolotlService.PEP_DEVICE_LIST, item, publishOptions);
|
||||
}
|
||||
|
||||
public Element publishBookmarkItem(final Bookmark bookmark) {
|
||||
final String name = bookmark.getBookmarkName();
|
||||
final String nick = bookmark.getNick();
|
||||
final boolean autojoin = bookmark.autojoin();
|
||||
final Element conference = new Element("conference", Namespace.BOOKMARKS2);
|
||||
if (name != null) {
|
||||
conference.setAttribute("name", name);
|
||||
}
|
||||
if (nick != null) {
|
||||
conference.addChild("nick").setContent(nick);
|
||||
}
|
||||
conference.setAttribute("autojoin",String.valueOf(autojoin));
|
||||
return conference;
|
||||
}
|
||||
|
||||
public IqPacket publishBundles(final SignedPreKeyRecord signedPreKeyRecord, final IdentityKey identityKey,
|
||||
final Set<PreKeyRecord> preKeyRecords, final int deviceId, Bundle publishOptions) {
|
||||
final Element item = new Element("item");
|
||||
|
@ -497,7 +530,7 @@ public class IqGenerator extends AbstractGenerator {
|
|||
options.putString("muc#roomconfig_allowinvites", "0");
|
||||
options.putString("muc#roomconfig_enablearchiving", "1"); //prosody
|
||||
options.putString("mam", "1"); //ejabberd community
|
||||
options.putString("muc#roomconfig_mam","1"); //ejabberd saas
|
||||
options.putString("muc#roomconfig_mam", "1"); //ejabberd saas
|
||||
return options;
|
||||
}
|
||||
|
||||
|
@ -510,7 +543,7 @@ public class IqGenerator extends AbstractGenerator {
|
|||
options.putString("muc#roomconfig_changesubject", "0");
|
||||
options.putString("muc#roomconfig_enablearchiving", "1"); //prosody
|
||||
options.putString("mam", "1"); //ejabberd community
|
||||
options.putString("muc#roomconfig_mam","1"); //ejabberd saas
|
||||
options.putString("muc#roomconfig_mam", "1"); //ejabberd saas
|
||||
return options;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.util.Collections;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -20,6 +21,7 @@ import eu.siacs.conversations.crypto.axolotl.BrokenSessionException;
|
|||
import eu.siacs.conversations.crypto.axolotl.NotEncryptedForThisDeviceException;
|
||||
import eu.siacs.conversations.crypto.axolotl.XmppAxolotlMessage;
|
||||
import eu.siacs.conversations.entities.Account;
|
||||
import eu.siacs.conversations.entities.Bookmark;
|
||||
import eu.siacs.conversations.entities.Contact;
|
||||
import eu.siacs.conversations.entities.Conversation;
|
||||
import eu.siacs.conversations.entities.Conversational;
|
||||
|
@ -110,7 +112,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
|
|||
return false;
|
||||
}
|
||||
|
||||
private Message parseAxolotlChat(Element axolotlMessage, Jid from, Conversation conversation, int status, boolean checkedForDuplicates, boolean postpone) {
|
||||
private Message parseAxolotlChat(Element axolotlMessage, Jid from, Conversation conversation, int status, final boolean checkedForDuplicates, boolean postpone) {
|
||||
final AxolotlService service = conversation.getAccount().getAxolotlService();
|
||||
final XmppAxolotlMessage xmppAxolotlMessage;
|
||||
try {
|
||||
|
@ -134,7 +136,6 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
|
|||
}
|
||||
} else {
|
||||
Log.d(Config.LOGTAG,"ignoring broken session exception because checkForDuplicates failed");
|
||||
//TODO should be still emit a failed message?
|
||||
return null;
|
||||
}
|
||||
} catch (NotEncryptedForThisDeviceException e) {
|
||||
|
@ -224,23 +225,55 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
|
|||
if (account.getXmppConnection().getFeatures().bookmarksConversion()) {
|
||||
final Element i = items.findChild("item");
|
||||
final Element storage = i == null ? null : i.findChild("storage", Namespace.BOOKMARKS);
|
||||
mXmppConnectionService.processBookmarks(account, storage, true);
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": processing bookmark PEP event");
|
||||
Map<Jid, Bookmark> bookmarks = Bookmark.parseFromStorage(storage, account);
|
||||
mXmppConnectionService.processBookmarksInitial(account, bookmarks, true);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": processing bookmark PEP event");
|
||||
} else {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": ignoring bookmark PEP event because bookmark conversion was not detected");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": ignoring bookmark PEP event because bookmark conversion was not detected");
|
||||
}
|
||||
} else if (Namespace.BOOKMARKS2.equals(node) && account.getJid().asBareJid().equals(from)) {
|
||||
final Element item = items.findChild("item");
|
||||
final Element retract = items.findChild("retract");
|
||||
if (item != null) {
|
||||
final Bookmark bookmark = Bookmark.parseFromItem(item, account);
|
||||
if (bookmark != null) {
|
||||
account.putBookmark(bookmark);
|
||||
mXmppConnectionService.processModifiedBookmark(bookmark);
|
||||
mXmppConnectionService.updateConversationUi();
|
||||
}
|
||||
}
|
||||
if (retract != null) {
|
||||
final Jid id = InvalidJid.getNullForInvalid(retract.getAttributeAsJid("id"));
|
||||
if (id != null) {
|
||||
account.removeBookmark(id);
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": deleted bookmark for "+id);
|
||||
mXmppConnectionService.processDeletedBookmark(account, id);
|
||||
mXmppConnectionService.updateConversationUi();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+" received pubsub notification for node="+node);
|
||||
}
|
||||
}
|
||||
|
||||
private void parseDeleteEvent(final Element event, final Jid from, final Account account) {
|
||||
final Element delete = event.findChild("delete");
|
||||
if (delete == null) {
|
||||
return;
|
||||
}
|
||||
String node = delete.getAttribute("node");
|
||||
final String node = delete == null ? null : delete.getAttribute("node");
|
||||
if (Namespace.NICK.equals(node)) {
|
||||
Log.d(Config.LOGTAG, "parsing nick delete event from " + from);
|
||||
setNick(account, from, null);
|
||||
} else if (Namespace.BOOKMARKS2.equals(node) && account.getJid().asBareJid().equals(from)) {
|
||||
account.setBookmarks(Collections.emptyMap());
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": deleted bookmarks node");
|
||||
}
|
||||
}
|
||||
|
||||
private void parsePurgeEvent(final Element event, final Jid from, final Account account) {
|
||||
final Element purge = event.findChild("purge");
|
||||
final String node = purge == null ? null : purge.getAttribute("node");
|
||||
if (Namespace.BOOKMARKS2.equals(node) && account.getJid().asBareJid().equals(from)) {
|
||||
account.setBookmarks(Collections.emptyMap());
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": purged bookmarks");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -463,8 +496,8 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
|
|||
origin = from;
|
||||
}
|
||||
|
||||
//TODO either or is probably fine?
|
||||
final boolean checkedForDuplicates = serverMsgId != null && remoteMsgId != null && !conversation.possibleDuplicate(serverMsgId, remoteMsgId);
|
||||
final boolean liveMessage = query == null && !isTypeGroupChat && mucUserElement == null;
|
||||
final boolean checkedForDuplicates = liveMessage || (serverMsgId != null && remoteMsgId != null && !conversation.possibleDuplicate(serverMsgId, remoteMsgId));
|
||||
|
||||
if (origin != null) {
|
||||
message = parseAxolotlChat(axolotlEncrypted, origin, conversation, status, checkedForDuplicates,query != null);
|
||||
|
@ -835,6 +868,8 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
|
|||
parseEvent(event, original.getFrom(), account);
|
||||
} else if (event.hasChild("delete")) {
|
||||
parseDeleteEvent(event, original.getFrom(), account);
|
||||
} else if (event.hasChild("purge")) {
|
||||
parsePurgeEvent(event, original.getFrom(), account);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@ import eu.siacs.conversations.Config;
|
|||
import eu.siacs.conversations.R;
|
||||
import eu.siacs.conversations.entities.DownloadableFile;
|
||||
import eu.siacs.conversations.entities.Message;
|
||||
import eu.siacs.conversations.services.AttachFileToConversationRunnable;
|
||||
import eu.siacs.conversations.services.XmppConnectionService;
|
||||
import eu.siacs.conversations.ui.RecordingActivity;
|
||||
import eu.siacs.conversations.ui.util.Attachment;
|
||||
|
@ -111,6 +112,7 @@ public class FileBackend {
|
|||
}
|
||||
|
||||
public static boolean allFilesUnderSize(Context context, List<Attachment> attachments, long max) {
|
||||
final boolean compressVideo = !AttachFileToConversationRunnable.getVideoCompression(context).equals("uncompressed");
|
||||
if (max <= 0) {
|
||||
Log.d(Config.LOGTAG, "server did not report max file size for http upload");
|
||||
return true; //exception to be compatible with HTTP Upload < v0.2
|
||||
|
@ -120,7 +122,7 @@ public class FileBackend {
|
|||
continue;
|
||||
}
|
||||
String mime = attachment.getMime();
|
||||
if (mime != null && mime.startsWith("video/")) {
|
||||
if (mime != null && mime.startsWith("video/") && compressVideo) {
|
||||
try {
|
||||
Dimensions dimensions = FileBackend.getVideoDimensions(context, attachment.getUri());
|
||||
if (dimensions.getMin() > 720) {
|
||||
|
@ -191,6 +193,14 @@ public class FileBackend {
|
|||
return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) + "/Camera/";
|
||||
}
|
||||
|
||||
public static Uri getUriForUri(Context context, Uri uri) {
|
||||
if ("file".equals(uri.getScheme())) {
|
||||
return getUriForFile(context, new File(uri.getPath()));
|
||||
} else {
|
||||
return uri;
|
||||
}
|
||||
}
|
||||
|
||||
public static Uri getUriForFile(Context context, File file) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N || Config.ONLY_INTERNAL_STORAGE) {
|
||||
try {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package eu.siacs.conversations.services;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
|
@ -177,7 +178,11 @@ public class AttachFileToConversationRunnable implements Runnable, MediaTranscod
|
|||
}
|
||||
|
||||
private String getVideoCompression() {
|
||||
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(mXmppConnectionService);
|
||||
return preferences.getString("video_compression", mXmppConnectionService.getResources().getString(R.string.video_compression));
|
||||
return getVideoCompression(mXmppConnectionService);
|
||||
}
|
||||
|
||||
public static String getVideoCompression(final Context context) {
|
||||
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
return preferences.getString("video_compression", context.getResources().getString(R.string.video_compression));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,6 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
|
@ -298,7 +297,7 @@ public class XmppConnectionService extends Service {
|
|||
|
||||
if (loggedInSuccessfully) {
|
||||
if (!TextUtils.isEmpty(account.getDisplayName())) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": display name wasn't empty on first log in. publishing");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": display name wasn't empty on first log in. publishing");
|
||||
publishDisplayName(account);
|
||||
}
|
||||
}
|
||||
|
@ -313,7 +312,12 @@ public class XmppConnectionService extends Service {
|
|||
mJingleConnectionManager.cancelInTransmission();
|
||||
mQuickConversationsService.considerSyncBackground(false);
|
||||
fetchRosterFromServer(account);
|
||||
if (!account.getXmppConnection().getFeatures().bookmarksConversion()) {
|
||||
|
||||
final XmppConnection connection = account.getXmppConnection();
|
||||
|
||||
if (connection.getFeatures().bookmarks2()) {
|
||||
fetchBookmarks2(account);
|
||||
} else if (!account.getXmppConnection().getFeatures().bookmarksConversion()) {
|
||||
fetchBookmarks(account);
|
||||
}
|
||||
final boolean flexible = account.getXmppConnection().getFeatures().flexibleOfflineMessageRetrieval();
|
||||
|
@ -522,8 +526,8 @@ public class XmppConnectionService extends Service {
|
|||
message.setCounterpart(conversation.getNextCounterpart());
|
||||
message.setType(Message.TYPE_FILE);
|
||||
}
|
||||
Log.d(Config.LOGTAG,"attachFile: type="+message.getType());
|
||||
Log.d(Config.LOGTAG,"counterpart="+message.getCounterpart());
|
||||
Log.d(Config.LOGTAG, "attachFile: type=" + message.getType());
|
||||
Log.d(Config.LOGTAG, "counterpart=" + message.getCounterpart());
|
||||
final AttachFileToConversationRunnable runnable = new AttachFileToConversationRunnable(this, uri, type, message, callback);
|
||||
if (runnable.isVideoMessage()) {
|
||||
mVideoCompressionExecutor.execute(runnable);
|
||||
|
@ -554,7 +558,7 @@ public class XmppConnectionService extends Service {
|
|||
message.setCounterpart(conversation.getNextCounterpart());
|
||||
message.setType(Message.TYPE_IMAGE);
|
||||
}
|
||||
Log.d(Config.LOGTAG,"attachImage: type="+message.getType());
|
||||
Log.d(Config.LOGTAG, "attachImage: type=" + message.getType());
|
||||
mFileAddingExecutor.execute(() -> {
|
||||
try {
|
||||
getFileBackend().copyImageToPrivateStorage(message, uri);
|
||||
|
@ -597,7 +601,7 @@ public class XmppConnectionService extends Service {
|
|||
final String action = intent == null ? null : intent.getAction();
|
||||
final boolean needsForegroundService = intent != null && intent.getBooleanExtra(EventReceiver.EXTRA_NEEDS_FOREGROUND_SERVICE, false);
|
||||
if (needsForegroundService) {
|
||||
Log.d(Config.LOGTAG,"toggle forced foreground service after receiving event (action="+action+")");
|
||||
Log.d(Config.LOGTAG, "toggle forced foreground service after receiving event (action=" + action + ")");
|
||||
toggleForegroundService(true);
|
||||
}
|
||||
String pushedAccountHash = null;
|
||||
|
@ -833,12 +837,12 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
|
||||
private void checkMucStillJoined(final Account account, final String hash, final String androidId) {
|
||||
for(final Conversation conversation : this.conversations) {
|
||||
for (final Conversation conversation : this.conversations) {
|
||||
if (conversation.getAccount() == account && conversation.getMode() == Conversational.MODE_MULTI) {
|
||||
Jid jid = conversation.getJid().asBareJid();
|
||||
final String currentHash = CryptoHelper.getFingerprint(jid, androidId);
|
||||
if (currentHash.equals(hash)) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": received cloud push notification for MUC "+jid);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": received cloud push notification for MUC " + jid);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1046,7 +1050,7 @@ public class XmppConnectionService extends Service {
|
|||
try {
|
||||
Security.insertProviderAt(Conscrypt.newProvider(), 1);
|
||||
} catch (Throwable throwable) {
|
||||
Log.e(Config.LOGTAG,"unable to initialize security provider", throwable);
|
||||
Log.e(Config.LOGTAG, "unable to initialize security provider", throwable);
|
||||
}
|
||||
Resolver.init(this);
|
||||
this.mRandom = new SecureRandom();
|
||||
|
@ -1133,7 +1137,7 @@ public class XmppConnectionService extends Service {
|
|||
final long start = SystemClock.elapsedRealtime();
|
||||
final List<DatabaseBackend.FilePathInfo> relativeFilePaths = databaseBackend.getFilePathInfo();
|
||||
final List<DatabaseBackend.FilePathInfo> changed = new ArrayList<>();
|
||||
for(final DatabaseBackend.FilePathInfo filePath : relativeFilePaths) {
|
||||
for (final DatabaseBackend.FilePathInfo filePath : relativeFilePaths) {
|
||||
if (destroyed) {
|
||||
Log.d(Config.LOGTAG, "Stop checking for deleted files because service has been destroyed");
|
||||
return;
|
||||
|
@ -1144,7 +1148,7 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
}
|
||||
final long duration = SystemClock.elapsedRealtime() - start;
|
||||
Log.d(Config.LOGTAG,"found "+changed.size()+" changed files on start up. total="+relativeFilePaths.size()+". ("+duration+"ms)");
|
||||
Log.d(Config.LOGTAG, "found " + changed.size() + " changed files on start up. total=" + relativeFilePaths.size() + ". (" + duration + "ms)");
|
||||
if (changed.size() > 0) {
|
||||
databaseBackend.markFilesAsChanged(changed);
|
||||
markChangedFiles(changed);
|
||||
|
@ -1225,7 +1229,7 @@ public class XmppConnectionService extends Service {
|
|||
if (!mForceForegroundService.get()) {
|
||||
mNotificationService.dismissForcedForegroundNotification(); //if the channel was changed the previous call might fail
|
||||
}
|
||||
Log.d(Config.LOGTAG,"ForegroundService: "+(status?"on":"off"));
|
||||
Log.d(Config.LOGTAG, "ForegroundService: " + (status ? "on" : "off"));
|
||||
}
|
||||
|
||||
public boolean foregroundNotificationNeedsUpdatingWhenErrorStateChanges() {
|
||||
|
@ -1365,7 +1369,7 @@ public class XmppConnectionService extends Service {
|
|||
if (QuickConversationsService.isQuicksy() && conversation.getMode() == Conversation.MODE_SINGLE) {
|
||||
final Contact contact = conversation.getContact();
|
||||
if (!contact.showInRoster() && contact.getOption(Contact.Options.SYNCED_VIA_OTHER)) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": adding "+contact.getJid()+" on sending message");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": adding " + contact.getJid() + " on sending message");
|
||||
createContact(contact, true);
|
||||
}
|
||||
}
|
||||
|
@ -1456,7 +1460,7 @@ public class XmppConnectionService extends Service {
|
|||
message.setBody(decryptedBody);
|
||||
message.setEncryption(Message.ENCRYPTION_DECRYPTED);
|
||||
if (!databaseBackend.updateMessage(message, message.getEditedId())) {
|
||||
Log.e(Config.LOGTAG,"error updated message in DB after edit");
|
||||
Log.e(Config.LOGTAG, "error updated message in DB after edit");
|
||||
}
|
||||
updateConversationUi();
|
||||
return;
|
||||
|
@ -1496,7 +1500,7 @@ public class XmppConnectionService extends Service {
|
|||
databaseBackend.createMessage(message);
|
||||
} else if (message.edited()) {
|
||||
if (!databaseBackend.updateMessage(message, message.getEditedId())) {
|
||||
Log.e(Config.LOGTAG,"error updated message in DB after edit");
|
||||
Log.e(Config.LOGTAG, "error updated message in DB after edit");
|
||||
}
|
||||
}
|
||||
updateConversationUi();
|
||||
|
@ -1522,7 +1526,7 @@ public class XmppConnectionService extends Service {
|
|||
final boolean pending = account.pendingConferenceJoins.contains(conversation);
|
||||
final boolean inProgressJoin = inProgress || pending;
|
||||
if (inProgressJoin) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": holding back message to group. inProgress="+inProgress+", pending="+pending);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": holding back message to group. inProgress=" + inProgress + ", pending=" + pending);
|
||||
}
|
||||
return inProgressJoin;
|
||||
} else {
|
||||
|
@ -1559,7 +1563,8 @@ public class XmppConnectionService extends Service {
|
|||
if (response.getType() == IqPacket.TYPE.RESULT) {
|
||||
final Element query1 = response.query();
|
||||
final Element storage = query1.findChild("storage", "storage:bookmarks");
|
||||
processBookmarks(a, storage, false);
|
||||
Map<Jid, Bookmark> bookmarks = Bookmark.parseFromStorage(storage, account);
|
||||
processBookmarksInitial(a, bookmarks, false);
|
||||
} else {
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": could not fetch bookmarks");
|
||||
}
|
||||
|
@ -1567,55 +1572,101 @@ public class XmppConnectionService extends Service {
|
|||
sendIqPacket(account, iqPacket, callback);
|
||||
}
|
||||
|
||||
public void processBookmarks(Account account, Element storage, final boolean pep) {
|
||||
public void fetchBookmarks2(final Account account) {
|
||||
final IqPacket retrieve = mIqGenerator.retrieveBookmarks();
|
||||
sendIqPacket(account, retrieve, new OnIqPacketReceived() {
|
||||
@Override
|
||||
public void onIqPacketReceived(final Account account, final IqPacket response) {
|
||||
if (response.getType() == IqPacket.TYPE.RESULT) {
|
||||
final Element pubsub = response.findChild("pubsub", Namespace.PUBSUB);
|
||||
final Map<Jid, Bookmark> bookmarks = Bookmark.parseFromPubsub(pubsub, account);
|
||||
processBookmarksInitial(account, bookmarks, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void processBookmarksInitial(Account account, Map<Jid, Bookmark> bookmarks, final boolean pep) {
|
||||
final Set<Jid> previousBookmarks = account.getBookmarkedJids();
|
||||
final HashMap<Jid, Bookmark> bookmarks = new HashMap<>();
|
||||
final boolean synchronizeWithBookmarks = synchronizeWithBookmarks();
|
||||
if (storage != null) {
|
||||
for (final Element item : storage.getChildren()) {
|
||||
if (item.getName().equals("conference")) {
|
||||
final Bookmark bookmark = Bookmark.parse(item, account);
|
||||
Bookmark old = bookmarks.put(bookmark.getJid(), bookmark);
|
||||
if (old != null && old.getBookmarkName() != null && bookmark.getBookmarkName() == null) {
|
||||
bookmark.setBookmarkName(old.getBookmarkName());
|
||||
}
|
||||
if (bookmark.getJid() == null) {
|
||||
continue;
|
||||
}
|
||||
for (Bookmark bookmark : bookmarks.values()) {
|
||||
previousBookmarks.remove(bookmark.getJid().asBareJid());
|
||||
processModifiedBookmark(bookmark, pep, synchronizeWithBookmarks);
|
||||
}
|
||||
if (pep && synchronizeWithBookmarks) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": " + previousBookmarks.size() + " bookmarks have been removed");
|
||||
for (Jid jid : previousBookmarks) {
|
||||
processDeletedBookmark(account, jid);
|
||||
}
|
||||
}
|
||||
account.setBookmarks(bookmarks);
|
||||
}
|
||||
|
||||
public void processDeletedBookmark(Account account, Jid jid) {
|
||||
final Conversation conversation = find(account, jid);
|
||||
if (conversation != null && conversation.getMucOptions().getError() == MucOptions.Error.DESTROYED) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": archiving destroyed conference (" + conversation.getJid() + ") after receiving pep");
|
||||
archiveConversation(conversation, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void processModifiedBookmark(Bookmark bookmark, final boolean pep, final boolean synchronizeWithBookmarks) {
|
||||
final Account account = bookmark.getAccount();
|
||||
Conversation conversation = find(bookmark);
|
||||
if (conversation != null) {
|
||||
if (conversation.getMode() != Conversation.MODE_MULTI) {
|
||||
continue;
|
||||
return;
|
||||
}
|
||||
bookmark.setConversation(conversation);
|
||||
if (pep && synchronizeWithBookmarks && !bookmark.autojoin()) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": archiving conference ("+conversation.getJid()+") after receiving pep");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": archiving conference (" + conversation.getJid() + ") after receiving pep");
|
||||
archiveConversation(conversation, false);
|
||||
} else {
|
||||
final MucOptions mucOptions = conversation.getMucOptions();
|
||||
if (mucOptions.getError() == MucOptions.Error.NICK_IN_USE) {
|
||||
final String current = mucOptions.getActualNick();
|
||||
final String proposed = mucOptions.getProposedNick();
|
||||
if (current != null && !current.equals(proposed)) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": proposed nick changed after bookmark push " + current + "->" + proposed);
|
||||
joinMuc(conversation);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (synchronizeWithBookmarks && bookmark.autojoin()) {
|
||||
conversation = findOrCreateConversation(account, bookmark.getFullJid(), true, true, false);
|
||||
bookmark.setConversation(conversation);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pep && synchronizeWithBookmarks) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": " + previousBookmarks.size() + " bookmarks have been removed");
|
||||
for (Jid jid : previousBookmarks) {
|
||||
final Conversation conversation = find(account, jid);
|
||||
if (conversation != null && conversation.getMucOptions().getError() == MucOptions.Error.DESTROYED) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": archiving destroyed conference ("+conversation.getJid()+") after receiving pep");
|
||||
archiveConversation(conversation, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
account.setBookmarks(new CopyOnWriteArrayList<>(bookmarks.values()));
|
||||
|
||||
public void processModifiedBookmark(Bookmark bookmark) {
|
||||
final boolean synchronizeWithBookmarks = synchronizeWithBookmarks();
|
||||
processModifiedBookmark(bookmark, true, synchronizeWithBookmarks);
|
||||
}
|
||||
|
||||
public void pushBookmarks(Account account) {
|
||||
public void createBookmark(final Account account, final Bookmark bookmark) {
|
||||
account.putBookmark(bookmark);
|
||||
final XmppConnection connection = account.getXmppConnection();
|
||||
if (connection != null && connection.getFeatures().bookmarksConversion()) {
|
||||
if (connection.getFeatures().bookmarks2()) {
|
||||
final Element item = mIqGenerator.publishBookmarkItem(bookmark);
|
||||
pushNodeAndEnforcePublishOptions(account, Namespace.BOOKMARKS2, item, bookmark.getJid().asBareJid().toEscapedString(), PublishOptions.persistentWhitelistAccessMaxItems());
|
||||
} else if (connection.getFeatures().bookmarksConversion()) {
|
||||
pushBookmarksPep(account);
|
||||
} else {
|
||||
pushBookmarksPrivateXml(account);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteBookmark(final Account account, final Bookmark bookmark) {
|
||||
account.removeBookmark(bookmark);
|
||||
final XmppConnection connection = account.getXmppConnection();
|
||||
if (connection.getFeatures().bookmarks2()) {
|
||||
IqPacket request = mIqGenerator.deleteItem(Namespace.BOOKMARKS2, bookmark.getJid().asBareJid().toEscapedString());
|
||||
sendIqPacket(account, request, (a, response) -> {
|
||||
if (response.getType() == IqPacket.TYPE.ERROR) {
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": unable to delete bookmark " + response.getError());
|
||||
}
|
||||
});
|
||||
} else if (connection.getFeatures().bookmarksConversion()) {
|
||||
pushBookmarksPep(account);
|
||||
} else {
|
||||
pushBookmarksPrivateXml(account);
|
||||
|
@ -1639,18 +1690,22 @@ public class XmppConnectionService extends Service {
|
|||
for (Bookmark bookmark : account.getBookmarks()) {
|
||||
storage.addChild(bookmark);
|
||||
}
|
||||
pushNodeAndEnforcePublishOptions(account,Namespace.BOOKMARKS,storage, PublishOptions.persistentWhitelistAccess());
|
||||
pushNodeAndEnforcePublishOptions(account, Namespace.BOOKMARKS, storage, PublishOptions.persistentWhitelistAccess());
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void pushNodeAndEnforcePublishOptions(final Account account, final String node, final Element element, final Bundle options) {
|
||||
pushNodeAndEnforcePublishOptions(account, node, element, options, true);
|
||||
pushNodeAndEnforcePublishOptions(account, node, element, null, options, true);
|
||||
|
||||
}
|
||||
|
||||
private void pushNodeAndEnforcePublishOptions(final Account account, final String node, final Element element, final Bundle options, final boolean retry) {
|
||||
final IqPacket packet = mIqGenerator.publishElement(node, element, options);
|
||||
private void pushNodeAndEnforcePublishOptions(final Account account, final String node, final Element element, final String id, final Bundle options) {
|
||||
pushNodeAndEnforcePublishOptions(account, node, element, id, options, true);
|
||||
|
||||
}
|
||||
|
||||
private void pushNodeAndEnforcePublishOptions(final Account account, final String node, final Element element, final String id, final Bundle options, final boolean retry) {
|
||||
final IqPacket packet = mIqGenerator.publishElement(node, element, id, options);
|
||||
sendIqPacket(account, packet, (a, response) -> {
|
||||
if (response.getType() == IqPacket.TYPE.RESULT) {
|
||||
return;
|
||||
|
@ -1659,16 +1714,16 @@ public class XmppConnectionService extends Service {
|
|||
pushNodeConfiguration(account, node, options, new OnConfigurationPushed() {
|
||||
@Override
|
||||
public void onPushSucceeded() {
|
||||
pushNodeAndEnforcePublishOptions(account, node, element, options, false);
|
||||
pushNodeAndEnforcePublishOptions(account, node, element, id, options, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPushFailed() {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": unable to push node configuration ("+node+")");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": unable to push node configuration (" + node + ")");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": error publishing bookmarks (retry="+Boolean.toString(retry)+") "+response);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": error publishing bookmarks (retry=" + Boolean.toString(retry) + ") " + response);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1715,7 +1770,7 @@ public class XmppConnectionService extends Service {
|
|||
restoreMessages(quickLoad);
|
||||
updateConversationUi();
|
||||
final long diffMessageRestore = SystemClock.elapsedRealtime() - startMessageRestore;
|
||||
Log.d(Config.LOGTAG,"quickly restored "+quickLoad.getName()+" after " + diffMessageRestore + "ms");
|
||||
Log.d(Config.LOGTAG, "quickly restored " + quickLoad.getName() + " after " + diffMessageRestore + "ms");
|
||||
}
|
||||
for (Conversation conversation : this.conversations) {
|
||||
if (quickLoad != conversation) {
|
||||
|
@ -1779,7 +1834,7 @@ public class XmppConnectionService extends Service {
|
|||
final File file = new File(path);
|
||||
final boolean isInternalFile = fileBackend.isInternalFile(file);
|
||||
final List<String> uuids = databaseBackend.markFileAsDeleted(file, isInternalFile);
|
||||
Log.d(Config.LOGTAG, "deleted file " + path+" internal="+isInternalFile+", database hits="+uuids.size());
|
||||
Log.d(Config.LOGTAG, "deleted file " + path + " internal=" + isInternalFile + ", database hits=" + uuids.size());
|
||||
markUuidsAsDeletedFiles(uuids);
|
||||
}
|
||||
|
||||
|
@ -1817,7 +1872,7 @@ public class XmppConnectionService extends Service {
|
|||
orderedUuids = null;
|
||||
} else {
|
||||
orderedUuids = new ArrayList<>();
|
||||
for(Conversation conversation : list) {
|
||||
for (Conversation conversation : list) {
|
||||
orderedUuids.add(conversation.getUuid());
|
||||
}
|
||||
}
|
||||
|
@ -2037,16 +2092,15 @@ public class XmppConnectionService extends Service {
|
|||
getMessageArchiveService().kill(conversation);
|
||||
if (conversation.getMode() == Conversation.MODE_MULTI) {
|
||||
if (conversation.getAccount().getStatus() == Account.State.ONLINE) {
|
||||
Bookmark bookmark = conversation.getBookmark();
|
||||
final Bookmark bookmark = conversation.getBookmark();
|
||||
if (maySynchronizeWithBookmarks && bookmark != null && synchronizeWithBookmarks()) {
|
||||
if (conversation.getMucOptions().getError() == MucOptions.Error.DESTROYED) {
|
||||
Account account = bookmark.getAccount();
|
||||
bookmark.setConversation(null);
|
||||
account.getBookmarks().remove(bookmark);
|
||||
pushBookmarks(account);
|
||||
deleteBookmark(account, bookmark);
|
||||
} else if (bookmark.autojoin()) {
|
||||
bookmark.setAutojoin(false);
|
||||
pushBookmarks(bookmark.getAccount());
|
||||
createBookmark(bookmark.getAccount(), bookmark);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2094,7 +2148,7 @@ public class XmppConnectionService extends Service {
|
|||
final int targetState = enabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED : PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
|
||||
getPackageManager().setComponentEnabledSetting(name, targetState, PackageManager.DONT_KILL_APP);
|
||||
} catch (IllegalStateException e) {
|
||||
Log.d(Config.LOGTAG,"unable to toggle profile picture actvitiy");
|
||||
Log.d(Config.LOGTAG, "unable to toggle profile picture actvitiy");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2198,18 +2252,24 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
|
||||
public void deleteAccount(final Account account) {
|
||||
final boolean connected = account.getStatus() == Account.State.ONLINE;
|
||||
synchronized (this.conversations) {
|
||||
if (connected) {
|
||||
account.getAxolotlService().deleteOmemoIdentity();
|
||||
}
|
||||
for (final Conversation conversation : conversations) {
|
||||
if (conversation.getAccount() == account) {
|
||||
if (conversation.getMode() == Conversation.MODE_MULTI) {
|
||||
if (connected) {
|
||||
leaveMuc(conversation);
|
||||
}
|
||||
}
|
||||
conversations.remove(conversation);
|
||||
mNotificationService.clear(conversation);
|
||||
}
|
||||
}
|
||||
if (account.getXmppConnection() != null) {
|
||||
new Thread(() -> disconnect(account, true)).start();
|
||||
new Thread(() -> disconnect(account, !connected)).start();
|
||||
}
|
||||
final Runnable runnable = () -> {
|
||||
if (!databaseBackend.deleteAccount(account)) {
|
||||
|
@ -2231,7 +2291,7 @@ public class XmppConnectionService extends Service {
|
|||
synchronized (LISTENER_LOCK) {
|
||||
remainingListeners = checkListeners();
|
||||
if (!this.mOnConversationUpdates.add(listener)) {
|
||||
Log.w(Config.LOGTAG,listener.getClass().getName()+" is already registered as ConversationListChangedListener");
|
||||
Log.w(Config.LOGTAG, listener.getClass().getName() + " is already registered as ConversationListChangedListener");
|
||||
}
|
||||
this.mNotificationService.setIsInForeground(this.mOnConversationUpdates.size() > 0);
|
||||
}
|
||||
|
@ -2257,7 +2317,7 @@ public class XmppConnectionService extends Service {
|
|||
synchronized (LISTENER_LOCK) {
|
||||
remainingListeners = checkListeners();
|
||||
if (!this.mOnShowErrorToasts.add(listener)) {
|
||||
Log.w(Config.LOGTAG,listener.getClass().getName()+" is already registered as OnShowErrorToastListener");
|
||||
Log.w(Config.LOGTAG, listener.getClass().getName() + " is already registered as OnShowErrorToastListener");
|
||||
}
|
||||
}
|
||||
if (remainingListeners) {
|
||||
|
@ -2281,7 +2341,7 @@ public class XmppConnectionService extends Service {
|
|||
synchronized (LISTENER_LOCK) {
|
||||
remainingListeners = checkListeners();
|
||||
if (!this.mOnAccountUpdates.add(listener)) {
|
||||
Log.w(Config.LOGTAG,listener.getClass().getName()+" is already registered as OnAccountListChangedtListener");
|
||||
Log.w(Config.LOGTAG, listener.getClass().getName() + " is already registered as OnAccountListChangedtListener");
|
||||
}
|
||||
}
|
||||
if (remainingListeners) {
|
||||
|
@ -2305,7 +2365,7 @@ public class XmppConnectionService extends Service {
|
|||
synchronized (LISTENER_LOCK) {
|
||||
remainingListeners = checkListeners();
|
||||
if (!this.mOnCaptchaRequested.add(listener)) {
|
||||
Log.w(Config.LOGTAG,listener.getClass().getName()+" is already registered as OnCaptchaRequestListener");
|
||||
Log.w(Config.LOGTAG, listener.getClass().getName() + " is already registered as OnCaptchaRequestListener");
|
||||
}
|
||||
}
|
||||
if (remainingListeners) {
|
||||
|
@ -2329,7 +2389,7 @@ public class XmppConnectionService extends Service {
|
|||
synchronized (LISTENER_LOCK) {
|
||||
remainingListeners = checkListeners();
|
||||
if (!this.mOnRosterUpdates.add(listener)) {
|
||||
Log.w(Config.LOGTAG,listener.getClass().getName()+" is already registered as OnRosterUpdateListener");
|
||||
Log.w(Config.LOGTAG, listener.getClass().getName() + " is already registered as OnRosterUpdateListener");
|
||||
}
|
||||
}
|
||||
if (remainingListeners) {
|
||||
|
@ -2353,7 +2413,7 @@ public class XmppConnectionService extends Service {
|
|||
synchronized (LISTENER_LOCK) {
|
||||
remainingListeners = checkListeners();
|
||||
if (!this.mOnUpdateBlocklist.add(listener)) {
|
||||
Log.w(Config.LOGTAG,listener.getClass().getName()+" is already registered as OnUpdateBlocklistListener");
|
||||
Log.w(Config.LOGTAG, listener.getClass().getName() + " is already registered as OnUpdateBlocklistListener");
|
||||
}
|
||||
}
|
||||
if (remainingListeners) {
|
||||
|
@ -2377,7 +2437,7 @@ public class XmppConnectionService extends Service {
|
|||
synchronized (LISTENER_LOCK) {
|
||||
remainingListeners = checkListeners();
|
||||
if (!this.mOnKeyStatusUpdated.add(listener)) {
|
||||
Log.w(Config.LOGTAG,listener.getClass().getName()+" is already registered as OnKeyStatusUpdateListener");
|
||||
Log.w(Config.LOGTAG, listener.getClass().getName() + " is already registered as OnKeyStatusUpdateListener");
|
||||
}
|
||||
}
|
||||
if (remainingListeners) {
|
||||
|
@ -2401,7 +2461,7 @@ public class XmppConnectionService extends Service {
|
|||
synchronized (LISTENER_LOCK) {
|
||||
remainingListeners = checkListeners();
|
||||
if (!this.mOnMucRosterUpdate.add(listener)) {
|
||||
Log.w(Config.LOGTAG,listener.getClass().getName()+" is already registered as OnMucRosterListener");
|
||||
Log.w(Config.LOGTAG, listener.getClass().getName() + " is already registered as OnMucRosterListener");
|
||||
}
|
||||
}
|
||||
if (remainingListeners) {
|
||||
|
@ -2501,7 +2561,7 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
synchronized (account.inProgressConferencePings) {
|
||||
if (!account.inProgressConferencePings.add(conversation)) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid()+": canceling muc self ping because ping is already under way");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": canceling muc self ping because ping is already under way");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -2513,13 +2573,13 @@ public class XmppConnectionService extends Service {
|
|||
if (response.getType() == IqPacket.TYPE.ERROR) {
|
||||
Element error = response.findChild("error");
|
||||
if (error == null || error.hasChild("service-unavailable") || error.hasChild("feature-not-implemented") || error.hasChild("item-not-found")) {
|
||||
Log.d(Config.LOGTAG,a.getJid().asBareJid()+": ping to "+self+" came back as ignorable error");
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": ping to " + self + " came back as ignorable error");
|
||||
} else {
|
||||
Log.d(Config.LOGTAG,a.getJid().asBareJid()+": ping to "+self+" failed. attempting rejoin");
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": ping to " + self + " failed. attempting rejoin");
|
||||
joinMuc(conversation);
|
||||
}
|
||||
} else if (response.getType() == IqPacket.TYPE.RESULT) {
|
||||
Log.d(Config.LOGTAG,a.getJid().asBareJid()+": ping to "+self+" came back fine");
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": ping to " + self + " came back fine");
|
||||
}
|
||||
synchronized (account.inProgressConferencePings) {
|
||||
account.inProgressConferencePings.remove(conversation);
|
||||
|
@ -2607,10 +2667,19 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
if (mucOptions.isPrivateAndNonAnonymous()) {
|
||||
fetchConferenceMembers(conversation);
|
||||
if (followedInvite && conversation.getBookmark() == null) {
|
||||
|
||||
if (followedInvite) {
|
||||
final Bookmark bookmark = conversation.getBookmark();
|
||||
if (bookmark != null) {
|
||||
if (!bookmark.autojoin()) {
|
||||
bookmark.setAutojoin(true);
|
||||
createBookmark(account, bookmark);
|
||||
}
|
||||
} else {
|
||||
saveConversationAsBookmark(conversation, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mucOptions.push()) {
|
||||
enableMucPush(conversation);
|
||||
}
|
||||
|
@ -2623,7 +2692,7 @@ public class XmppConnectionService extends Service {
|
|||
@Override
|
||||
public void onConferenceConfigurationFetched(Conversation conversation) {
|
||||
if (conversation.getStatus() == Conversation.STATUS_ARCHIVED) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": conversation ("+conversation.getJid()+") got archived before IQ result");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": conversation (" + conversation.getJid() + ") got archived before IQ result");
|
||||
return;
|
||||
}
|
||||
join(conversation);
|
||||
|
@ -2632,7 +2701,7 @@ public class XmppConnectionService extends Service {
|
|||
@Override
|
||||
public void onFetchFailed(final Conversation conversation, Element error) {
|
||||
if (conversation.getStatus() == Conversation.STATUS_ARCHIVED) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": conversation ("+conversation.getJid()+") got archived before IQ result");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": conversation (" + conversation.getJid() + ") got archived before IQ result");
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -2666,9 +2735,9 @@ public class XmppConnectionService extends Service {
|
|||
enable.setTo(room);
|
||||
sendIqPacket(account, enable, (a, response) -> {
|
||||
if (response.getType() == IqPacket.TYPE.RESULT) {
|
||||
Log.d(Config.LOGTAG,a.getJid().asBareJid()+": enabled direct push for muc "+room);
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": enabled direct push for muc " + room);
|
||||
} else if (response.getType() == IqPacket.TYPE.ERROR) {
|
||||
Log.d(Config.LOGTAG,a.getJid().asBareJid()+": unable to enable direct push for muc "+room+" "+response.getError());
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": unable to enable direct push for muc " + room + " " + response.getError());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -2685,9 +2754,9 @@ public class XmppConnectionService extends Service {
|
|||
disable.setTo(room);
|
||||
sendIqPacket(account, disable, (a, response) -> {
|
||||
if (response.getType() == IqPacket.TYPE.RESULT) {
|
||||
Log.d(Config.LOGTAG,a.getJid().asBareJid()+": disabled direct push for muc "+room);
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": disabled direct push for muc " + room);
|
||||
} else if (response.getType() == IqPacket.TYPE.ERROR) {
|
||||
Log.d(Config.LOGTAG,a.getJid().asBareJid()+": unable to disable direct push for muc "+room+" "+response.getError());
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": unable to disable direct push for muc " + room + " " + response.getError());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -2761,10 +2830,11 @@ public class XmppConnectionService extends Service {
|
|||
if (conversation.getMode() == Conversation.MODE_MULTI) {
|
||||
conversation.getMucOptions().setPassword(password);
|
||||
if (conversation.getBookmark() != null) {
|
||||
final Bookmark bookmark = conversation.getBookmark();
|
||||
if (synchronizeWithBookmarks()) {
|
||||
conversation.getBookmark().setAutojoin(true);
|
||||
bookmark.setAutojoin(true);
|
||||
}
|
||||
pushBookmarks(conversation.getAccount());
|
||||
createBookmark(conversation.getAccount(), bookmark);
|
||||
}
|
||||
updateConversation(conversation);
|
||||
joinMuc(conversation);
|
||||
|
@ -2789,7 +2859,7 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
|
||||
public void getAttachments(final Account account, final Jid jid, final int limit, final OnMediaLoaded onMediaLoaded) {
|
||||
getAttachments(account.getUuid(),jid.asBareJid(),limit, onMediaLoaded);
|
||||
getAttachments(account.getUuid(), jid.asBareJid(), limit, onMediaLoaded);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2813,12 +2883,12 @@ public class XmppConnectionService extends Service {
|
|||
final Account account = conversation.getAccount();
|
||||
final String defaultNick = MucOptions.defaultNick(account);
|
||||
if (TextUtils.isEmpty(bookmarkedNick) && full.getResource().equals(defaultNick)) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": do not overwrite empty bookmark nick with default nick for "+conversation.getJid().asBareJid());
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": do not overwrite empty bookmark nick with default nick for " + conversation.getJid().asBareJid());
|
||||
return;
|
||||
}
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": persist nick '" + full.getResource() + "' into bookmark for " + conversation.getJid().asBareJid());
|
||||
bookmark.setNick(full.getResource());
|
||||
pushBookmarks(bookmark.getAccount());
|
||||
createBookmark(bookmark.getAccount(), bookmark);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2853,7 +2923,7 @@ public class XmppConnectionService extends Service {
|
|||
Bookmark bookmark = conversation.getBookmark();
|
||||
if (bookmark != null) {
|
||||
bookmark.setNick(nick);
|
||||
pushBookmarks(bookmark.getAccount());
|
||||
createBookmark(bookmark.getAccount(), bookmark);
|
||||
}
|
||||
joinMuc(conversation);
|
||||
}
|
||||
|
@ -2962,9 +3032,9 @@ public class XmppConnectionService extends Service {
|
|||
for (Jid invite : jids) {
|
||||
invite(conversation, invite);
|
||||
}
|
||||
for(String resource : account.getSelfContact().getPresences().toResourceArray()) {
|
||||
for (String resource : account.getSelfContact().getPresences().toResourceArray()) {
|
||||
Jid other = account.getJid().withResource(resource);
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": sending direct invite to "+other);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": sending direct invite to " + other);
|
||||
directInvite(conversation, other);
|
||||
}
|
||||
saveConversationAsBookmark(conversation, name);
|
||||
|
@ -3021,7 +3091,7 @@ public class XmppConnectionService extends Service {
|
|||
|
||||
if (bookmark != null && (sameBefore || bookmark.getBookmarkName() == null)) {
|
||||
if (bookmark.setBookmarkName(StringUtils.nullOnEmpty(mucOptions.getName()))) {
|
||||
pushBookmarks(account);
|
||||
createBookmark(account, bookmark);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3033,7 +3103,7 @@ public class XmppConnectionService extends Service {
|
|||
|
||||
updateConversationUi();
|
||||
} else if (packet.getType() == IqPacket.TYPE.TIMEOUT) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": received timeout waiting for conference configuration fetch");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": received timeout waiting for conference configuration fetch");
|
||||
} else {
|
||||
if (callback != null) {
|
||||
callback.onFetchFailed(conversation, packet.getError());
|
||||
|
@ -3048,7 +3118,7 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
|
||||
public void pushNodeConfiguration(Account account, final Jid jid, final String node, final Bundle options, final OnConfigurationPushed callback) {
|
||||
Log.d(Config.LOGTAG,"pushing node configuration");
|
||||
Log.d(Config.LOGTAG, "pushing node configuration");
|
||||
sendIqPacket(account, mIqGenerator.requestPubsubConfiguration(jid, node), new OnIqPacketReceived() {
|
||||
@Override
|
||||
public void onIqPacketReceived(Account account, IqPacket packet) {
|
||||
|
@ -3063,7 +3133,7 @@ public class XmppConnectionService extends Service {
|
|||
@Override
|
||||
public void onIqPacketReceived(Account account, IqPacket packet) {
|
||||
if (packet.getType() == IqPacket.TYPE.RESULT && callback != null) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": successfully changed node configuration for node "+node);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": successfully changed node configuration for node " + node);
|
||||
callback.onPushSucceeded();
|
||||
} else if (packet.getType() == IqPacket.TYPE.ERROR && callback != null) {
|
||||
callback.onPushFailed();
|
||||
|
@ -3081,8 +3151,8 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
|
||||
public void pushConferenceConfiguration(final Conversation conversation, final Bundle options, final OnConfigurationPushed callback) {
|
||||
if (options.getString("muc#roomconfig_whois","moderators").equals("anyone")) {
|
||||
conversation.setAttribute("accept_non_anonymous",true);
|
||||
if (options.getString("muc#roomconfig_whois", "moderators").equals("anyone")) {
|
||||
conversation.setAttribute("accept_non_anonymous", true);
|
||||
updateConversation(conversation);
|
||||
}
|
||||
IqPacket request = new IqPacket(IqPacket.TYPE.GET);
|
||||
|
@ -3156,7 +3226,7 @@ public class XmppConnectionService extends Service {
|
|||
Log.d(Config.LOGTAG, request.toString());
|
||||
sendIqPacket(conference.getAccount(), request, (account, packet) -> {
|
||||
if (packet.getType() != IqPacket.TYPE.RESULT) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+" unable to change role of "+nick);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + " unable to change role of " + nick);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -3216,7 +3286,7 @@ public class XmppConnectionService extends Service {
|
|||
|
||||
public void updateMessage(Message message, String uuid) {
|
||||
if (!databaseBackend.updateMessage(message, uuid)) {
|
||||
Log.e(Config.LOGTAG,"error updated message in DB after edit");
|
||||
Log.e(Config.LOGTAG, "error updated message in DB after edit");
|
||||
}
|
||||
updateConversationUi();
|
||||
}
|
||||
|
@ -3288,7 +3358,7 @@ public class XmppConnectionService extends Service {
|
|||
final Avatar avatar = getFileBackend().getPepAvatar(image, size, format);
|
||||
if (avatar != null) {
|
||||
if (!getFileBackend().save(avatar)) {
|
||||
Log.d(Config.LOGTAG,"unable to save vcard");
|
||||
Log.d(Config.LOGTAG, "unable to save vcard");
|
||||
callback.onAvatarPublicationFailed(R.string.error_saving_avatar);
|
||||
return;
|
||||
}
|
||||
|
@ -3345,25 +3415,25 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
|
||||
public void publishAvatar(Account account, final Avatar avatar, final Bundle options, final boolean retry, final OnAvatarPublication callback) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": publishing avatar. options="+options);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": publishing avatar. options=" + options);
|
||||
IqPacket packet = this.mIqGenerator.publishAvatar(avatar, options);
|
||||
this.sendIqPacket(account, packet, new OnIqPacketReceived() {
|
||||
|
||||
@Override
|
||||
public void onIqPacketReceived(Account account, IqPacket result) {
|
||||
if (result.getType() == IqPacket.TYPE.RESULT) {
|
||||
publishAvatarMetadata(account, avatar, options,true, callback);
|
||||
publishAvatarMetadata(account, avatar, options, true, callback);
|
||||
} else if (retry && PublishOptions.preconditionNotMet(result)) {
|
||||
pushNodeConfiguration(account, "urn:xmpp:avatar:data", options, new OnConfigurationPushed() {
|
||||
@Override
|
||||
public void onPushSucceeded() {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": changed node configuration for avatar node");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": changed node configuration for avatar node");
|
||||
publishAvatar(account, avatar, options, false, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPushFailed() {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": unable to change node configuration for avatar node");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": unable to change node configuration for avatar node");
|
||||
publishAvatar(account, avatar, null, false, callback);
|
||||
}
|
||||
});
|
||||
|
@ -3397,14 +3467,14 @@ public class XmppConnectionService extends Service {
|
|||
pushNodeConfiguration(account, "urn:xmpp:avatar:metadata", options, new OnConfigurationPushed() {
|
||||
@Override
|
||||
public void onPushSucceeded() {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": changed node configuration for avatar meta data node");
|
||||
publishAvatarMetadata(account, avatar, options,false, callback);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": changed node configuration for avatar meta data node");
|
||||
publishAvatarMetadata(account, avatar, options, false, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPushFailed() {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": unable to change node configuration for avatar meta data node");
|
||||
publishAvatarMetadata(account, avatar, null,false, callback);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": unable to change node configuration for avatar meta data node");
|
||||
publishAvatarMetadata(account, avatar, null, false, callback);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@ -3481,7 +3551,7 @@ public class XmppConnectionService extends Service {
|
|||
} else if (avatar.origin == Avatar.Origin.PEP) {
|
||||
mOmittedPepAvatarFetches.add(KEY);
|
||||
} else {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": already fetching "+avatar.origin+" avatar for "+avatar.owner);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": already fetching " + avatar.origin + " avatar for " + avatar.owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3558,7 +3628,7 @@ public class XmppConnectionService extends Service {
|
|||
avatar.image = image;
|
||||
if (getFileBackend().save(avatar)) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid()
|
||||
+ ": successfully fetched vCard avatar for " + avatar.owner+" omittedPep="+previouslyOmittedPepFetch);
|
||||
+ ": successfully fetched vCard avatar for " + avatar.owner + " omittedPep=" + previouslyOmittedPepFetch);
|
||||
if (avatar.owner.isBareJid()) {
|
||||
if (account.getJid().asBareJid().equals(avatar.owner) && account.getAvatar() == null) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": had no avatar. replacing with vcard");
|
||||
|
@ -3639,8 +3709,8 @@ public class XmppConnectionService extends Service {
|
|||
public void notifyAccountAvatarHasChanged(final Account account) {
|
||||
final XmppConnection connection = account.getXmppConnection();
|
||||
if (connection != null && connection.getFeatures().bookmarksConversion()) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": avatar changed. resending presence to online group chats");
|
||||
for(Conversation conversation : conversations) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": avatar changed. resending presence to online group chats");
|
||||
for (Conversation conversation : conversations) {
|
||||
if (conversation.getAccount() == account && conversation.getMode() == Conversational.MODE_MULTI) {
|
||||
final MucOptions mucOptions = conversation.getMucOptions();
|
||||
if (mucOptions.online()) {
|
||||
|
@ -3770,11 +3840,11 @@ public class XmppConnectionService extends Service {
|
|||
|
||||
|
||||
public void markMessage(Message message, int status, String errorMessage) {
|
||||
final int c = message.getStatus();
|
||||
if (status == Message.STATUS_SEND_FAILED && (c == Message.STATUS_SEND_RECEIVED || c == Message.STATUS_SEND_DISPLAYED)) {
|
||||
final int oldStatus = message.getStatus();
|
||||
if (status == Message.STATUS_SEND_FAILED && (oldStatus == Message.STATUS_SEND_RECEIVED || oldStatus == Message.STATUS_SEND_DISPLAYED)) {
|
||||
return;
|
||||
}
|
||||
if (status == Message.STATUS_SEND_RECEIVED && c == Message.STATUS_SEND_DISPLAYED) {
|
||||
if (status == Message.STATUS_SEND_RECEIVED && oldStatus == Message.STATUS_SEND_DISPLAYED) {
|
||||
return;
|
||||
}
|
||||
message.setErrorMessage(errorMessage);
|
||||
|
@ -3917,7 +3987,7 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
|
||||
public Account findAccountByUuid(final String uuid) {
|
||||
for(Account account : this.accounts) {
|
||||
for (Account account : this.accounts) {
|
||||
if (account.getUuid().equals(uuid)) {
|
||||
return account;
|
||||
}
|
||||
|
@ -4100,7 +4170,7 @@ public class XmppConnectionService extends Service {
|
|||
if (connection != null) {
|
||||
connection.sendIqPacket(packet, callback);
|
||||
} else if (callback != null) {
|
||||
callback.onIqPacketReceived(account,new IqPacket(IqPacket.TYPE.TIMEOUT));
|
||||
callback.onIqPacketReceived(account, new IqPacket(IqPacket.TYPE.TIMEOUT));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4324,7 +4394,7 @@ public class XmppConnectionService extends Service {
|
|||
mAvatarService.clear(account);
|
||||
sendIqPacket(account, request, (account1, packet) -> {
|
||||
if (packet.getType() == IqPacket.TYPE.ERROR) {
|
||||
Log.d(Config.LOGTAG, account1.getJid().asBareJid() + ": unable to modify nick name "+packet.toString());
|
||||
Log.d(Config.LOGTAG, account1.getJid().asBareJid() + ": unable to modify nick name " + packet.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -4356,7 +4426,7 @@ public class XmppConnectionService extends Service {
|
|||
final String ver = presence.getVer();
|
||||
final Element query = request.query("http://jabber.org/protocol/disco#info");
|
||||
if (node != null && ver != null) {
|
||||
query.setAttribute("node",node+"#"+ver);
|
||||
query.setAttribute("node", node + "#" + ver);
|
||||
}
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": making disco request for " + key.second + " to " + jid);
|
||||
sendIqPacket(account, request, (a, response) -> {
|
||||
|
@ -4435,8 +4505,7 @@ public class XmppConnectionService extends Service {
|
|||
bookmark.setBookmarkName(name);
|
||||
}
|
||||
bookmark.setAutojoin(getPreferences().getBoolean("autojoin", getResources().getBoolean(R.bool.autojoin)));
|
||||
account.getBookmarks().add(bookmark);
|
||||
pushBookmarks(account);
|
||||
createBookmark(account, bookmark);
|
||||
bookmark.setConversation(conversation);
|
||||
}
|
||||
|
||||
|
@ -4582,7 +4651,7 @@ public class XmppConnectionService extends Service {
|
|||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
onStartCommand(intent,0,0);
|
||||
onStartCommand(intent, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import eu.siacs.conversations.Config;
|
||||
import eu.siacs.conversations.R;
|
||||
import eu.siacs.conversations.databinding.ActivityChannelDiscoveryBinding;
|
||||
import eu.siacs.conversations.entities.Account;
|
||||
|
@ -217,20 +218,21 @@ public class ChannelDiscoveryActivity extends XmppActivity implements MenuItem.O
|
|||
return false;
|
||||
}
|
||||
|
||||
public void joinChannelSearchResult(String accountJid, MuclumbusService.Room result) {
|
||||
final boolean syncAutojoin = getBooleanPreference("autojoin", R.bool.autojoin);
|
||||
Account account = xmppConnectionService.findAccountByJid(Jid.of(accountJid));
|
||||
public void joinChannelSearchResult(String selectedAccount, MuclumbusService.Room result) {
|
||||
final Jid jid = Config.DOMAIN_LOCK == null ? Jid.of(selectedAccount) : Jid.of(selectedAccount, Config.DOMAIN_LOCK, null);
|
||||
final boolean syncAutoJoin = getBooleanPreference("autojoin", R.bool.autojoin);
|
||||
final Account account = xmppConnectionService.findAccountByJid(jid);
|
||||
final Conversation conversation = xmppConnectionService.findOrCreateConversation(account, result.getRoom(), true, true, true);
|
||||
if (conversation.getBookmark() != null) {
|
||||
if (!conversation.getBookmark().autojoin() && syncAutojoin) {
|
||||
conversation.getBookmark().setAutojoin(true);
|
||||
xmppConnectionService.pushBookmarks(account);
|
||||
Bookmark bookmark = conversation.getBookmark();
|
||||
if (bookmark != null) {
|
||||
if (!bookmark.autojoin() && syncAutoJoin) {
|
||||
bookmark.setAutojoin(true);
|
||||
xmppConnectionService.createBookmark(account, bookmark);
|
||||
}
|
||||
} else {
|
||||
final Bookmark bookmark = new Bookmark(account, conversation.getJid().asBareJid());
|
||||
bookmark.setAutojoin(syncAutojoin);
|
||||
account.getBookmarks().add(bookmark);
|
||||
xmppConnectionService.pushBookmarks(account);
|
||||
bookmark = new Bookmark(account, conversation.getJid().asBareJid());
|
||||
bookmark.setAutojoin(syncAutoJoin);
|
||||
xmppConnectionService.createBookmark(account, bookmark);
|
||||
}
|
||||
switchToConversation(conversation);
|
||||
}
|
||||
|
|
|
@ -386,11 +386,10 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
|
|||
}
|
||||
|
||||
protected void deleteBookmark() {
|
||||
Account account = mConversation.getAccount();
|
||||
Bookmark bookmark = mConversation.getBookmark();
|
||||
account.getBookmarks().remove(bookmark);
|
||||
final Account account = mConversation.getAccount();
|
||||
final Bookmark bookmark = mConversation.getBookmark();
|
||||
bookmark.setConversation(null);
|
||||
xmppConnectionService.pushBookmarks(account);
|
||||
xmppConnectionService.deleteBookmark(account, bookmark);
|
||||
updateView();
|
||||
}
|
||||
|
||||
|
|
|
@ -1044,6 +1044,10 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
|
|||
return;
|
||||
}
|
||||
|
||||
if (m.getStatus() == Message.STATUS_RECEIVED && t != null && (t.getStatus() == Transferable.STATUS_CANCELLED || t.getStatus() == Transferable.STATUS_FAILED)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean deleted = m.isDeleted();
|
||||
final boolean encrypted = m.getEncryption() == Message.ENCRYPTION_DECRYPTION_FAILED
|
||||
|| m.getEncryption() == Message.ENCRYPTION_PGP;
|
||||
|
|
|
@ -431,7 +431,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
|
|||
bookmark.setConversation(conversation);
|
||||
if (!bookmark.autojoin() && getPreferences().getBoolean("autojoin", getResources().getBoolean(R.bool.autojoin))) {
|
||||
bookmark.setAutojoin(true);
|
||||
xmppConnectionService.pushBookmarks(bookmark.getAccount());
|
||||
xmppConnectionService.createBookmark(bookmark.getAccount(), bookmark);
|
||||
}
|
||||
SoftKeyboardUtils.hideSoftKeyboard(this);
|
||||
switchToConversation(conversation);
|
||||
|
@ -478,9 +478,8 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
|
|||
builder.setMessage(JidDialog.style(this, R.string.remove_bookmark_text, bookmark.getJid().toEscapedString()));
|
||||
builder.setPositiveButton(R.string.delete, (dialog, which) -> {
|
||||
bookmark.setConversation(null);
|
||||
Account account = bookmark.getAccount();
|
||||
account.getBookmarks().remove(bookmark);
|
||||
xmppConnectionService.pushBookmarks(account);
|
||||
final Account account = bookmark.getAccount();
|
||||
xmppConnectionService.deleteBookmark(account, bookmark);
|
||||
filter(mSearchEditText.getText().toString());
|
||||
});
|
||||
builder.create().show();
|
||||
|
@ -1041,8 +1040,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
|
|||
if (nick != null && !nick.isEmpty() && !nick.equals(MucOptions.defaultNick(account))) {
|
||||
bookmark.setNick(nick);
|
||||
}
|
||||
account.getBookmarks().add(bookmark);
|
||||
xmppConnectionService.pushBookmarks(account);
|
||||
xmppConnectionService.createBookmark(account, bookmark);
|
||||
final Conversation conversation = xmppConnectionService
|
||||
.findOrCreateConversation(account, conferenceJid, true, true, true);
|
||||
bookmark.setConversation(conversation);
|
||||
|
|
|
@ -1,17 +1,21 @@
|
|||
package eu.siacs.conversations.ui.adapter;
|
||||
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.databinding.DataBindingUtil;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
|
@ -20,6 +24,7 @@ import java.util.concurrent.RejectedExecutionException;
|
|||
|
||||
import eu.siacs.conversations.R;
|
||||
import eu.siacs.conversations.databinding.MediaPreviewBinding;
|
||||
import eu.siacs.conversations.persistance.FileBackend;
|
||||
import eu.siacs.conversations.ui.ConversationFragment;
|
||||
import eu.siacs.conversations.ui.XmppActivity;
|
||||
import eu.siacs.conversations.ui.util.Attachment;
|
||||
|
@ -54,11 +59,24 @@ public class MediaPreviewAdapter extends RecyclerView.Adapter<MediaPreviewAdapte
|
|||
MediaAdapter.renderPreview(context, attachment, holder.binding.mediaPreview);
|
||||
}
|
||||
holder.binding.deleteButton.setOnClickListener(v -> {
|
||||
int pos = mediaPreviews.indexOf(attachment);
|
||||
final int pos = mediaPreviews.indexOf(attachment);
|
||||
mediaPreviews.remove(pos);
|
||||
notifyItemRemoved(pos);
|
||||
conversationFragment.toggleInputMethod();
|
||||
});
|
||||
holder.binding.mediaPreview.setOnClickListener(v -> view(context, attachment));
|
||||
}
|
||||
|
||||
private static void view(final Context context, Attachment attachment) {
|
||||
final Intent view = new Intent(Intent.ACTION_VIEW);
|
||||
final Uri uri = FileBackend.getUriForUri(context, attachment.getUri());
|
||||
view.setDataAndType(uri, attachment.getMime());
|
||||
view.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
try {
|
||||
context.startActivity(view);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Toast.makeText(context, R.string.no_application_found_to_open_file, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
public void addMediaPreviews(List<Attachment> attachments) {
|
||||
|
|
|
@ -187,7 +187,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
|
|||
if (message.isFileOrImage() || transferable != null) {
|
||||
FileParams params = message.getFileParams();
|
||||
filesize = params.size > 0 ? UIHelper.filesizeToString(params.size) : null;
|
||||
if (transferable != null && transferable.getStatus() == Transferable.STATUS_FAILED) {
|
||||
if (transferable != null && (transferable.getStatus() == Transferable.STATUS_FAILED || transferable.getStatus() == Transferable.STATUS_CANCELLED)) {
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
|
@ -206,10 +206,6 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
|
|||
info = getContext().getString(R.string.offering);
|
||||
break;
|
||||
case Message.STATUS_SEND_RECEIVED:
|
||||
if (mIndicateReceived) {
|
||||
viewHolder.indicatorReceived.setVisibility(View.VISIBLE);
|
||||
}
|
||||
break;
|
||||
case Message.STATUS_SEND_DISPLAYED:
|
||||
if (mIndicateReceived) {
|
||||
viewHolder.indicatorReceived.setVisibility(View.VISIBLE);
|
||||
|
|
|
@ -53,11 +53,10 @@ public class ShareUtil {
|
|||
if (message.isGeoUri()) {
|
||||
shareIntent.putExtra(Intent.EXTRA_TEXT, message.getBody());
|
||||
shareIntent.setType("text/plain");
|
||||
shareIntent.putExtra(ConversationsActivity.EXTRA_AS_QUOTE, true);
|
||||
} else if (!message.isFileOrImage()) {
|
||||
shareIntent.putExtra(Intent.EXTRA_TEXT, message.getMergedBody().toString());
|
||||
shareIntent.setType("text/plain");
|
||||
shareIntent.putExtra(ConversationsActivity.EXTRA_AS_QUOTE, true);
|
||||
shareIntent.putExtra(ConversationsActivity.EXTRA_AS_QUOTE, message.getStatus() == Message.STATUS_RECEIVED);
|
||||
} else {
|
||||
final DownloadableFile file = activity.xmppConnectionService.getFileBackend().getFile(message);
|
||||
try {
|
||||
|
|
|
@ -14,23 +14,25 @@ public class SocksSocketFactory {
|
|||
|
||||
private static final byte[] LOCALHOST = new byte[]{127,0,0,1};
|
||||
|
||||
public static void createSocksConnection(Socket socket, String destination, int port) throws IOException {
|
||||
InputStream proxyIs = socket.getInputStream();
|
||||
OutputStream proxyOs = socket.getOutputStream();
|
||||
public static void createSocksConnection(final Socket socket, final String destination, final int port) throws IOException {
|
||||
final InputStream proxyIs = socket.getInputStream();
|
||||
final OutputStream proxyOs = socket.getOutputStream();
|
||||
proxyOs.write(new byte[]{0x05, 0x01, 0x00});
|
||||
byte[] response = new byte[2];
|
||||
proxyIs.read(response);
|
||||
if (response[0] != 0x05 || response[1] != 0x00) {
|
||||
proxyOs.flush();
|
||||
final byte[] handshake = new byte[2];
|
||||
proxyIs.read(handshake);
|
||||
if (handshake[0] != 0x05 || handshake[1] != 0x00) {
|
||||
throw new SocksConnectionException("Socks 5 handshake failed");
|
||||
}
|
||||
byte[] dest = destination.getBytes();
|
||||
ByteBuffer request = ByteBuffer.allocate(7 + dest.length);
|
||||
final byte[] dest = destination.getBytes();
|
||||
final ByteBuffer request = ByteBuffer.allocate(7 + dest.length);
|
||||
request.put(new byte[]{0x05, 0x01, 0x00, 0x03});
|
||||
request.put((byte) dest.length);
|
||||
request.put(dest);
|
||||
request.putShort((short) port);
|
||||
proxyOs.write(request.array());
|
||||
response = new byte[7 + dest.length];
|
||||
proxyOs.flush();
|
||||
final byte[] response = new byte[7 + dest.length];
|
||||
proxyIs.read(response);
|
||||
if (response[1] != 0x00) {
|
||||
if (response[1] == 0x04) {
|
||||
|
@ -52,7 +54,7 @@ public class SocksSocketFactory {
|
|||
return false;
|
||||
}
|
||||
|
||||
public static Socket createSocket(InetSocketAddress address, String destination, int port) throws IOException {
|
||||
private static Socket createSocket(InetSocketAddress address, String destination, int port) throws IOException {
|
||||
Socket socket = new Socket();
|
||||
try {
|
||||
socket.connect(address, Config.CONNECT_TIMEOUT * 1000);
|
||||
|
|
|
@ -274,6 +274,8 @@ public class UIHelper {
|
|||
getFileDescriptionString(context, message)), true);
|
||||
case Transferable.STATUS_FAILED:
|
||||
return new Pair<>(context.getString(R.string.file_transmission_failed), true);
|
||||
case Transferable.STATUS_CANCELLED:
|
||||
return new Pair<>(context.getString(R.string.file_transmission_cancelled), true);
|
||||
case Transferable.STATUS_UPLOADING:
|
||||
if (message.getStatus() == Message.STATUS_OFFERED) {
|
||||
return new Pair<>(context.getString(R.string.offering_x_file,
|
||||
|
|
|
@ -33,4 +33,6 @@ public final class Namespace {
|
|||
public static final String JINGLE_ENCRYPTED_TRANSPORT = "urn:xmpp:jingle:jet:0";
|
||||
public static final String JINGLE_ENCRYPTED_TRANSPORT_OMEMO = "urn:xmpp:jingle:jet-omemo:0";
|
||||
public static final String MUC_USER = "http://jabber.org/protocol/muc#user";
|
||||
public static final String BOOKMARKS2 = "urn:xmpp:bookmarks:0";
|
||||
public static final String BOOKMARKS2_COMPAT = BOOKMARKS2+"#compat";
|
||||
}
|
||||
|
|
|
@ -1857,5 +1857,9 @@ public class XmppConnection implements Runnable {
|
|||
public boolean stanzaIds() {
|
||||
return hasDiscoFeature(account.getJid().asBareJid(), Namespace.STANZA_IDS);
|
||||
}
|
||||
|
||||
public boolean bookmarks2() {
|
||||
return Config.USE_BOOKMARKS2 /* || hasDiscoFeature(account.getJid().asBareJid(), Namespace.BOOKMARKS2_COMPAT)*/;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ public class JingleConnection implements Transferable {
|
|||
|
||||
@Override
|
||||
public void onFileTransferAborted() {
|
||||
JingleConnection.this.sendCancel();
|
||||
JingleConnection.this.sendSessionTerminate("connectivity-error");
|
||||
JingleConnection.this.fail();
|
||||
}
|
||||
};
|
||||
|
@ -222,27 +222,32 @@ public class JingleConnection implements Transferable {
|
|||
return this.message.getCounterpart();
|
||||
}
|
||||
|
||||
public void deliverPacket(JinglePacket packet) {
|
||||
boolean returnResult = true;
|
||||
void deliverPacket(JinglePacket packet) {
|
||||
if (packet.isAction("session-terminate")) {
|
||||
Reason reason = packet.getReason();
|
||||
if (reason != null) {
|
||||
if (reason.hasChild("cancel")) {
|
||||
this.cancelled = true;
|
||||
this.fail();
|
||||
} else if (reason.hasChild("success")) {
|
||||
this.receiveSuccess();
|
||||
} else {
|
||||
final List<Element> children = reason.getChildren();
|
||||
if (children.size() == 1) {
|
||||
this.fail(children.get(0).getName());
|
||||
} else {
|
||||
this.fail();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.fail();
|
||||
}
|
||||
} else if (packet.isAction("session-accept")) {
|
||||
returnResult = receiveAccept(packet);
|
||||
receiveAccept(packet);
|
||||
} else if (packet.isAction("session-info")) {
|
||||
Element checksum = packet.getChecksum();
|
||||
Element file = checksum == null ? null : checksum.findChild("file");
|
||||
Element hash = file == null ? null : file.findChild("hash", "urn:xmpp:hashes:2");
|
||||
final Element checksum = packet.getChecksum();
|
||||
final Element file = checksum == null ? null : checksum.findChild("file");
|
||||
final Element hash = file == null ? null : file.findChild("hash", "urn:xmpp:hashes:2");
|
||||
if (hash != null && "sha-1".equalsIgnoreCase(hash.getAttribute("algo"))) {
|
||||
try {
|
||||
this.expectedHash = Base64.decode(hash.getContent(), Base64.DEFAULT);
|
||||
|
@ -250,33 +255,44 @@ public class JingleConnection implements Transferable {
|
|||
this.expectedHash = new byte[0];
|
||||
}
|
||||
}
|
||||
respondToIq(packet, true);
|
||||
} else if (packet.isAction("transport-info")) {
|
||||
returnResult = receiveTransportInfo(packet);
|
||||
receiveTransportInfo(packet);
|
||||
} else if (packet.isAction("transport-replace")) {
|
||||
if (packet.getJingleContent().hasIbbTransport()) {
|
||||
returnResult = this.receiveFallbackToIbb(packet);
|
||||
receiveFallbackToIbb(packet);
|
||||
} else {
|
||||
returnResult = false;
|
||||
Log.d(Config.LOGTAG, "trying to fallback to something unknown"
|
||||
+ packet.toString());
|
||||
Log.d(Config.LOGTAG, "trying to fallback to something unknown" + packet.toString());
|
||||
respondToIq(packet, false);
|
||||
}
|
||||
} else if (packet.isAction("transport-accept")) {
|
||||
returnResult = this.receiveTransportAccept(packet);
|
||||
receiveTransportAccept(packet);
|
||||
} else {
|
||||
Log.d(Config.LOGTAG, "packet arrived in connection. action was "
|
||||
+ packet.getAction());
|
||||
returnResult = false;
|
||||
Log.d(Config.LOGTAG, "packet arrived in connection. action was " + packet.getAction());
|
||||
respondToIq(packet, false);
|
||||
}
|
||||
}
|
||||
IqPacket response;
|
||||
if (returnResult) {
|
||||
response = packet.generateResponse(IqPacket.TYPE.RESULT);
|
||||
|
||||
private void respondToIq(final IqPacket packet, final boolean result) {
|
||||
final IqPacket response;
|
||||
if (result) {
|
||||
response = packet.generateResponse(IqPacket.TYPE.RESULT);
|
||||
} else {
|
||||
response = packet.generateResponse(IqPacket.TYPE.ERROR);
|
||||
final Element error = response.addChild("error").setAttribute("type", "cancel");
|
||||
error.addChild("not-acceptable", "urn:ietf:params:xml:ns:xmpp-stanzas");
|
||||
}
|
||||
mXmppConnectionService.sendIqPacket(account, response, null);
|
||||
}
|
||||
|
||||
private void respondToIqWithOutOfOrder(final IqPacket packet) {
|
||||
final IqPacket response = packet.generateResponse(IqPacket.TYPE.ERROR);
|
||||
final Element error = response.addChild("error").setAttribute("type", "wait");
|
||||
error.addChild("unexpected-request", "urn:ietf:params:xml:ns:xmpp-stanzas");
|
||||
error.addChild("out-of-order", "urn:xmpp:jingle:errors:1");
|
||||
mXmppConnectionService.sendIqPacket(account, response, null);
|
||||
}
|
||||
|
||||
public void init(final Message message) {
|
||||
if (message.getEncryption() == Message.ENCRYPTION_AXOLOTL) {
|
||||
Conversation conversation = (Conversation) message.getConversation();
|
||||
|
@ -320,7 +336,7 @@ public class JingleConnection implements Transferable {
|
|||
|
||||
@Override
|
||||
public void failed() {
|
||||
Log.d(Config.LOGTAG, "connection to our own proxy65 candidate failed");
|
||||
Log.d(Config.LOGTAG, String.format("connection to our own proxy65 candidate failed (%s:%d)", candidate.getHost(), candidate.getPort()));
|
||||
sendInitRequest();
|
||||
}
|
||||
|
||||
|
@ -400,7 +416,6 @@ public class JingleConnection implements Transferable {
|
|||
this.contentName = content.getAttribute("name");
|
||||
this.transportId = content.getTransportId();
|
||||
|
||||
mXmppConnectionService.sendIqPacket(account, packet.generateResponse(IqPacket.TYPE.RESULT), null);
|
||||
|
||||
if (this.initialTransport == Transport.SOCKS) {
|
||||
this.mergeCandidates(JingleCandidate.parse(content.socks5transport().getChildren()));
|
||||
|
@ -411,20 +426,20 @@ public class JingleConnection implements Transferable {
|
|||
this.ibbBlockSize = Math.min(Integer.parseInt(receivedBlockSize), this.ibbBlockSize);
|
||||
} catch (NumberFormatException e) {
|
||||
Log.d(Config.LOGTAG, "number format exception " + e.getMessage());
|
||||
this.sendCancel();
|
||||
respondToIq(packet, false);
|
||||
this.fail();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
Log.d(Config.LOGTAG, "received block size was null");
|
||||
this.sendCancel();
|
||||
respondToIq(packet, false);
|
||||
this.fail();
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.ftVersion = content.getVersion();
|
||||
if (ftVersion == null) {
|
||||
this.sendCancel();
|
||||
respondToIq(packet, false);
|
||||
this.fail();
|
||||
return;
|
||||
}
|
||||
|
@ -486,6 +501,9 @@ public class JingleConnection implements Transferable {
|
|||
//JET reports the plain text size. however lower levels of our receiving code still
|
||||
//expect the cipher text size. so we just + 16 bytes (auth tag size) here
|
||||
this.file.setExpectedSize(size + (remoteIsUsingJet ? 16 : 0));
|
||||
|
||||
respondToIq(packet, true);
|
||||
|
||||
if (mJingleConnectionManager.hasStoragePermission()
|
||||
&& size < this.mJingleConnectionManager.getAutoAcceptFileSize()
|
||||
&& mXmppConnectionService.isDataSaverDisabled()) {
|
||||
|
@ -503,13 +521,9 @@ public class JingleConnection implements Transferable {
|
|||
this.mXmppConnectionService.getNotificationService().push(message);
|
||||
}
|
||||
Log.d(Config.LOGTAG, "receiving file: expecting size of " + this.file.getExpectedSize());
|
||||
} else {
|
||||
this.sendCancel();
|
||||
this.fail();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
this.sendCancel();
|
||||
this.fail();
|
||||
respondToIq(packet, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -557,14 +571,17 @@ public class JingleConnection implements Transferable {
|
|||
try {
|
||||
this.mFileInputStream = new FileInputStream(file);
|
||||
} catch (FileNotFoundException e) {
|
||||
abort();
|
||||
fail(e.getMessage());
|
||||
return;
|
||||
}
|
||||
content.setTransportId(this.transportId);
|
||||
if (this.initialTransport == Transport.IBB) {
|
||||
content.ibbTransport().setAttribute("block-size", Integer.toString(this.ibbBlockSize));
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": sending IBB offer");
|
||||
} else {
|
||||
content.socks5transport().setChildren(getCandidatesAsElements());
|
||||
final List<Element> candidates = getCandidatesAsElements();
|
||||
Log.d(Config.LOGTAG, String.format("%s: sending S5B offer with %d candidates", account.getJid().asBareJid(), candidates.size()));
|
||||
content.socks5transport().setChildren(candidates);
|
||||
}
|
||||
packet.setContent(content);
|
||||
this.sendJinglePacket(packet, (account, response) -> {
|
||||
|
@ -682,18 +699,19 @@ public class JingleConnection implements Transferable {
|
|||
mXmppConnectionService.sendIqPacket(account, packet, callback);
|
||||
}
|
||||
|
||||
private boolean receiveAccept(JinglePacket packet) {
|
||||
private void receiveAccept(JinglePacket packet) {
|
||||
if (this.mJingleStatus != JINGLE_STATUS_INITIATED) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": received out of order session-accept");
|
||||
return false;
|
||||
respondToIqWithOutOfOrder(packet);
|
||||
return;
|
||||
}
|
||||
this.mJingleStatus = JINGLE_STATUS_ACCEPTED;
|
||||
mXmppConnectionService.markMessage(message, Message.STATUS_UNSEND);
|
||||
Content content = packet.getJingleContent();
|
||||
if (content.hasSocks5Transport()) {
|
||||
respondToIq(packet, true);
|
||||
mergeCandidates(JingleCandidate.parse(content.socks5transport().getChildren()));
|
||||
this.connectNextCandidate();
|
||||
return true;
|
||||
} else if (content.hasIbbTransport()) {
|
||||
String receivedBlockSize = packet.getJingleContent().ibbTransport().getAttribute("block-size");
|
||||
if (receivedBlockSize != null) {
|
||||
|
@ -706,18 +724,19 @@ public class JingleConnection implements Transferable {
|
|||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": unable to parse block size in session-accept");
|
||||
}
|
||||
}
|
||||
respondToIq(packet, true);
|
||||
this.transport = new JingleInbandTransport(this, this.transportId, this.ibbBlockSize);
|
||||
this.transport.connect(onIbbTransportConnected);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
respondToIq(packet, false);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean receiveTransportInfo(JinglePacket packet) {
|
||||
Content content = packet.getJingleContent();
|
||||
private void receiveTransportInfo(JinglePacket packet) {
|
||||
final Content content = packet.getJingleContent();
|
||||
if (content.hasSocks5Transport()) {
|
||||
if (content.socks5transport().hasChild("activated")) {
|
||||
respondToIq(packet, true);
|
||||
if ((this.transport != null) && (this.transport instanceof JingleSocks5Transport)) {
|
||||
onProxyActivated.success();
|
||||
} else {
|
||||
|
@ -729,21 +748,20 @@ public class JingleConnection implements Transferable {
|
|||
connection.setActivated(true);
|
||||
} else {
|
||||
Log.d(Config.LOGTAG, "activated connection not found");
|
||||
this.sendCancel();
|
||||
sendSessionTerminate("failed-transport");
|
||||
this.fail();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else if (content.socks5transport().hasChild("proxy-error")) {
|
||||
respondToIq(packet, true);
|
||||
onProxyActivated.failed();
|
||||
return true;
|
||||
} else if (content.socks5transport().hasChild("candidate-error")) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": received candidate error");
|
||||
respondToIq(packet, true);
|
||||
this.receivedCandidate = true;
|
||||
if (mJingleStatus == JINGLE_STATUS_ACCEPTED && this.sentCandidate) {
|
||||
this.connect();
|
||||
}
|
||||
return true;
|
||||
} else if (content.socks5transport().hasChild("candidate-used")) {
|
||||
String cid = content.socks5transport().findChild("candidate-used").getAttribute("cid");
|
||||
if (cid != null) {
|
||||
|
@ -751,8 +769,10 @@ public class JingleConnection implements Transferable {
|
|||
JingleCandidate candidate = getCandidate(cid);
|
||||
if (candidate == null) {
|
||||
Log.d(Config.LOGTAG, "could not find candidate with cid=" + cid);
|
||||
return false;
|
||||
respondToIq(packet, false);
|
||||
return;
|
||||
}
|
||||
respondToIq(packet, true);
|
||||
candidate.flagAsUsedByCounterpart();
|
||||
this.receivedCandidate = true;
|
||||
if (mJingleStatus == JINGLE_STATUS_ACCEPTED && this.sentCandidate) {
|
||||
|
@ -760,15 +780,14 @@ public class JingleConnection implements Transferable {
|
|||
} else {
|
||||
Log.d(Config.LOGTAG, "ignoring because file is already in transmission or we haven't sent our candidate yet status=" + mJingleStatus + " sentCandidate=" + sentCandidate);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
respondToIq(packet, false);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
respondToIq(packet, false);
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
respondToIq(packet, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -867,11 +886,7 @@ public class JingleConnection implements Transferable {
|
|||
}
|
||||
|
||||
private void sendSuccess() {
|
||||
JinglePacket packet = bootstrapPacket("session-terminate");
|
||||
Reason reason = new Reason();
|
||||
reason.addChild("success");
|
||||
packet.setReason(reason);
|
||||
this.sendJinglePacket(packet);
|
||||
sendSessionTerminate("success");
|
||||
this.disconnectSocks5Connections();
|
||||
this.mJingleStatus = JINGLE_STATUS_FINISHED;
|
||||
this.message.setStatus(Message.STATUS_RECEIVED);
|
||||
|
@ -893,7 +908,7 @@ public class JingleConnection implements Transferable {
|
|||
}
|
||||
|
||||
|
||||
private boolean receiveFallbackToIbb(JinglePacket packet) {
|
||||
private void receiveFallbackToIbb(JinglePacket packet) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": receiving fallback to ibb");
|
||||
final String receivedBlockSize = packet.getJingleContent().ibbTransport().getAttribute("block-size");
|
||||
if (receivedBlockSize != null) {
|
||||
|
@ -916,6 +931,7 @@ public class JingleConnection implements Transferable {
|
|||
content.ibbTransport().setAttribute("sid", this.transportId);
|
||||
answer.setContent(content);
|
||||
|
||||
respondToIq(packet, true);
|
||||
|
||||
if (initiating()) {
|
||||
this.sendJinglePacket(answer, (account, response) -> {
|
||||
|
@ -928,13 +944,13 @@ public class JingleConnection implements Transferable {
|
|||
this.transport.receive(file, onFileTransmissionStatusChanged);
|
||||
this.sendJinglePacket(answer);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean receiveTransportAccept(JinglePacket packet) {
|
||||
private void receiveTransportAccept(JinglePacket packet) {
|
||||
if (packet.getJingleContent().hasIbbTransport()) {
|
||||
String receivedBlockSize = packet.getJingleContent().ibbTransport()
|
||||
.getAttribute("block-size");
|
||||
final Element ibbTransport = packet.getJingleContent().ibbTransport();
|
||||
final String receivedBlockSize = ibbTransport.getAttribute("block-size");
|
||||
final String sid = ibbTransport.getAttribute("sid");
|
||||
if (receivedBlockSize != null) {
|
||||
try {
|
||||
int bs = Integer.parseInt(receivedBlockSize);
|
||||
|
@ -947,15 +963,19 @@ public class JingleConnection implements Transferable {
|
|||
}
|
||||
this.transport = new JingleInbandTransport(this, this.transportId, this.ibbBlockSize);
|
||||
|
||||
if (sid == null || !sid.equals(this.transportId)) {
|
||||
Log.w(Config.LOGTAG, String.format("%s: sid in transport-accept (%s) did not match our sid (%s) ", account.getJid().asBareJid(), sid, transportId));
|
||||
}
|
||||
respondToIq(packet, true);
|
||||
//might be receive instead if we are not initiating
|
||||
if (initiating()) {
|
||||
this.transport.connect(onIbbTransportConnected);
|
||||
} else {
|
||||
this.transport.receive(file, onFileTransmissionStatusChanged);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": received invalid transport-accept");
|
||||
respondToIq(packet, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -977,18 +997,18 @@ public class JingleConnection implements Transferable {
|
|||
@Override
|
||||
public void cancel() {
|
||||
this.cancelled = true;
|
||||
abort();
|
||||
abort("cancel");
|
||||
}
|
||||
|
||||
public void abort() {
|
||||
void abort(final String reason) {
|
||||
this.disconnectSocks5Connections();
|
||||
if (this.transport instanceof JingleInbandTransport) {
|
||||
this.transport.disconnect();
|
||||
}
|
||||
this.sendCancel();
|
||||
sendSessionTerminate(reason);
|
||||
this.mJingleConnectionManager.finishConnection(this);
|
||||
if (responding()) {
|
||||
this.message.setTransferable(new TransferablePlaceholder(Transferable.STATUS_FAILED));
|
||||
this.message.setTransferable(new TransferablePlaceholder(cancelled ? Transferable.STATUS_CANCELLED : Transferable.STATUS_FAILED));
|
||||
if (this.file != null) {
|
||||
file.delete();
|
||||
}
|
||||
|
@ -1013,7 +1033,7 @@ public class JingleConnection implements Transferable {
|
|||
FileBackend.close(mFileOutputStream);
|
||||
if (this.message != null) {
|
||||
if (responding()) {
|
||||
this.message.setTransferable(new TransferablePlaceholder(Transferable.STATUS_FAILED));
|
||||
this.message.setTransferable(new TransferablePlaceholder(cancelled ? Transferable.STATUS_CANCELLED : Transferable.STATUS_FAILED));
|
||||
if (this.file != null) {
|
||||
file.delete();
|
||||
}
|
||||
|
@ -1028,11 +1048,11 @@ public class JingleConnection implements Transferable {
|
|||
this.mJingleConnectionManager.finishConnection(this);
|
||||
}
|
||||
|
||||
private void sendCancel() {
|
||||
JinglePacket packet = bootstrapPacket("session-terminate");
|
||||
Reason reason = new Reason();
|
||||
reason.addChild("cancel");
|
||||
packet.setReason(reason);
|
||||
private void sendSessionTerminate(String reason) {
|
||||
final JinglePacket packet = bootstrapPacket("session-terminate");
|
||||
final Reason r = new Reason();
|
||||
r.addChild(reason);
|
||||
packet.setReason(r);
|
||||
this.sendJinglePacket(packet);
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ public class JingleConnectionManager extends AbstractConnectionManager {
|
|||
candidate.setPort(Integer.parseInt(port));
|
||||
candidate.setType(JingleCandidate.TYPE_PROXY);
|
||||
candidate.setJid(proxy);
|
||||
candidate.setPriority(655360 + (initiator ? 10 : 20));
|
||||
candidate.setPriority(655360 + (initiator ? 30 : 0));
|
||||
primaryCandidates.put(account.getJid().asBareJid(),candidate);
|
||||
listener.onPrimaryCandidateFound(true,candidate);
|
||||
} catch (final NumberFormatException e) {
|
||||
|
@ -166,7 +166,7 @@ public class JingleConnectionManager extends AbstractConnectionManager {
|
|||
public void cancelInTransmission() {
|
||||
for (JingleConnection connection : this.connections) {
|
||||
if (connection.getJingleStatus() == JingleConnection.JINGLE_STATUS_TRANSMITTING) {
|
||||
connection.abort();
|
||||
connection.abort("connectivity-error");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,10 +48,15 @@ public class JingleInbandTransport extends JingleTransport {
|
|||
private OnIqPacketReceived onAckReceived = new OnIqPacketReceived() {
|
||||
@Override
|
||||
public void onIqPacketReceived(Account account, IqPacket packet) {
|
||||
if (connected && packet.getType() == IqPacket.TYPE.RESULT) {
|
||||
if (!connected) {
|
||||
return;
|
||||
}
|
||||
if (packet.getType() == IqPacket.TYPE.RESULT) {
|
||||
if (remainingSize > 0) {
|
||||
sendNextBlock();
|
||||
}
|
||||
} else if (packet.getType() == IqPacket.TYPE.ERROR) {
|
||||
onFileTransmissionStatusChanged.onFileTransferAborted();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -80,18 +85,12 @@ public class JingleInbandTransport extends JingleTransport {
|
|||
open.setAttribute("stanza", "iq");
|
||||
open.setAttribute("block-size", Integer.toString(this.blockSize));
|
||||
this.connected = true;
|
||||
this.account.getXmppConnection().sendIqPacket(iq,
|
||||
new OnIqPacketReceived() {
|
||||
|
||||
@Override
|
||||
public void onIqPacketReceived(Account account,
|
||||
IqPacket packet) {
|
||||
this.account.getXmppConnection().sendIqPacket(iq, (account, packet) -> {
|
||||
if (packet.getType() != IqPacket.TYPE.RESULT) {
|
||||
callback.failed();
|
||||
} else {
|
||||
callback.established();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -104,13 +103,13 @@ public class JingleInbandTransport extends JingleTransport {
|
|||
digest.reset();
|
||||
this.fileOutputStream = connection.getFileOutputStream();
|
||||
if (this.fileOutputStream == null) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": could not create output stream");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": could not create output stream");
|
||||
callback.onFileTransferAborted();
|
||||
return;
|
||||
}
|
||||
this.remainingSize = this.fileSize = file.getExpectedSize();
|
||||
} catch (final NoSuchAlgorithmException | IOException e) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+" "+e.getMessage());
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + " " + e.getMessage());
|
||||
callback.onFileTransferAborted();
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +125,7 @@ public class JingleInbandTransport extends JingleTransport {
|
|||
this.digest.reset();
|
||||
fileInputStream = connection.getFileInputStream();
|
||||
if (fileInputStream == null) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": could no create input stream");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": could no create input stream");
|
||||
callback.onFileTransferAborted();
|
||||
return;
|
||||
}
|
||||
|
@ -136,7 +135,7 @@ public class JingleInbandTransport extends JingleTransport {
|
|||
}
|
||||
} catch (Exception e) {
|
||||
callback.onFileTransferAborted();
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": "+e.getMessage());
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -154,19 +153,19 @@ public class JingleInbandTransport extends JingleTransport {
|
|||
if (count == -1) {
|
||||
sendClose();
|
||||
file.setSha1Sum(digest.digest());
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": sendNextBlock() count was -1");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": sendNextBlock() count was -1");
|
||||
this.onFileTransmissionStatusChanged.onFileTransmitted(file);
|
||||
fileInputStream.close();
|
||||
return;
|
||||
} else if (count != buffer.length) {
|
||||
int rem = innerInputStream.read(buffer,count,buffer.length-count);
|
||||
int rem = innerInputStream.read(buffer, count, buffer.length - count);
|
||||
if (rem > 0) {
|
||||
count += rem;
|
||||
}
|
||||
}
|
||||
this.remainingSize -= count;
|
||||
this.digest.update(buffer,0,count);
|
||||
String base64 = Base64.encodeToString(buffer,0,count, Base64.NO_WRAP);
|
||||
this.digest.update(buffer, 0, count);
|
||||
String base64 = Base64.encodeToString(buffer, 0, count, Base64.NO_WRAP);
|
||||
IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
|
||||
iq.setTo(this.counterpart);
|
||||
Element data = iq.addChild("data", "http://jabber.org/protocol/ibb");
|
||||
|
@ -185,7 +184,7 @@ public class JingleInbandTransport extends JingleTransport {
|
|||
fileInputStream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": io exception during sendNextBlock() "+e.getMessage());
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": io exception during sendNextBlock() " + e.getMessage());
|
||||
FileBackend.close(fileInputStream);
|
||||
this.onFileTransmissionStatusChanged.onFileTransferAborted();
|
||||
}
|
||||
|
@ -204,13 +203,13 @@ public class JingleInbandTransport extends JingleTransport {
|
|||
file.setSha1Sum(digest.digest());
|
||||
fileOutputStream.flush();
|
||||
fileOutputStream.close();
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": receive next block nothing remaining");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": receive next block nothing remaining");
|
||||
this.onFileTransmissionStatusChanged.onFileTransmitted(file);
|
||||
} else {
|
||||
connection.updateProgress((int) ((((double) (this.fileSize - this.remainingSize)) / this.fileSize) * 100));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": "+e.getMessage());
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": " + e.getMessage());
|
||||
FileBackend.close(fileOutputStream);
|
||||
this.onFileTransmissionStatusChanged.onFileTransferAborted();
|
||||
}
|
||||
|
@ -236,9 +235,9 @@ public class JingleInbandTransport extends JingleTransport {
|
|||
this.connected = false;
|
||||
this.account.getXmppConnection().sendIqPacket(
|
||||
packet.generateResponse(IqPacket.TYPE.RESULT), null);
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": received ibb close");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": received ibb close");
|
||||
} else {
|
||||
Log.d(Config.LOGTAG,payload.toString());
|
||||
Log.d(Config.LOGTAG, payload.toString());
|
||||
// TODO some sort of exception
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,10 @@ import eu.siacs.conversations.utils.WakeLockHelper;
|
|||
import eu.siacs.conversations.xmpp.jingle.stanzas.Content;
|
||||
|
||||
public class JingleSocks5Transport extends JingleTransport {
|
||||
|
||||
private static final int SOCKET_TIMEOUT_DIRECT = 3000;
|
||||
private static final int SOCKET_TIMEOUT_PROXY = 5000;
|
||||
|
||||
private final JingleCandidate candidate;
|
||||
private final JingleConnection connection;
|
||||
private final String destination;
|
||||
|
@ -92,8 +96,9 @@ public class JingleSocks5Transport extends JingleTransport {
|
|||
}
|
||||
}
|
||||
|
||||
private void acceptIncomingSocketConnection(Socket socket) throws IOException {
|
||||
private void acceptIncomingSocketConnection(final Socket socket) throws IOException {
|
||||
Log.d(Config.LOGTAG, "accepted connection from " + socket.getInetAddress().getHostAddress());
|
||||
socket.setSoTimeout(SOCKET_TIMEOUT_DIRECT);
|
||||
final byte[] authBegin = new byte[2];
|
||||
final InputStream inputStream = socket.getInputStream();
|
||||
final OutputStream outputStream = socket.getOutputStream();
|
||||
|
@ -115,7 +120,8 @@ public class JingleSocks5Transport extends JingleTransport {
|
|||
int destinationCount = inputStream.read();
|
||||
final byte[] destination = new byte[destinationCount];
|
||||
inputStream.read(destination);
|
||||
final int port = inputStream.read();
|
||||
final byte[] port = new byte[2];
|
||||
inputStream.read(port);
|
||||
final String receivedDestination = new String(destination);
|
||||
final ByteBuffer response = ByteBuffer.allocate(7 + destination.length);
|
||||
final byte[] responseHeader;
|
||||
|
@ -131,11 +137,12 @@ public class JingleSocks5Transport extends JingleTransport {
|
|||
response.put(responseHeader);
|
||||
response.put((byte) destination.length);
|
||||
response.put(destination);
|
||||
response.putShort((short) port);
|
||||
response.put(port);
|
||||
outputStream.write(response.array());
|
||||
outputStream.flush();
|
||||
if (success) {
|
||||
Log.d(Config.LOGTAG,connection.getAccount().getJid().asBareJid()+": successfully processed connection to candidate "+candidate.getHost()+":"+candidate.getPort());
|
||||
socket.setSoTimeout(0);
|
||||
this.socket = socket;
|
||||
this.inputStream = inputStream;
|
||||
this.outputStream = outputStream;
|
||||
|
@ -151,6 +158,7 @@ public class JingleSocks5Transport extends JingleTransport {
|
|||
|
||||
public void connect(final OnTransportConnected callback) {
|
||||
new Thread(() -> {
|
||||
final int timeout = candidate.getType() == JingleCandidate.TYPE_DIRECT ? SOCKET_TIMEOUT_DIRECT : SOCKET_TIMEOUT_PROXY;
|
||||
try {
|
||||
final boolean useTor = connection.getAccount().isOnion() || connection.getConnectionManager().getXmppConnectionService().useTorToConnect();
|
||||
if (useTor) {
|
||||
|
@ -158,11 +166,11 @@ public class JingleSocks5Transport extends JingleTransport {
|
|||
} else {
|
||||
socket = new Socket();
|
||||
SocketAddress address = new InetSocketAddress(candidate.getHost(), candidate.getPort());
|
||||
socket.connect(address, 5000);
|
||||
socket.connect(address, timeout);
|
||||
}
|
||||
inputStream = socket.getInputStream();
|
||||
outputStream = socket.getOutputStream();
|
||||
socket.setSoTimeout(5000);
|
||||
socket.setSoTimeout(timeout);
|
||||
SocksSocketFactory.createSocksConnection(socket, destination, 0);
|
||||
socket.setSoTimeout(0);
|
||||
isEstablished = true;
|
||||
|
|
|
@ -14,14 +14,27 @@ public class PublishOptions {
|
|||
|
||||
public static Bundle openAccess() {
|
||||
final Bundle options = new Bundle();
|
||||
options.putString("pubsub#access_model","open");
|
||||
options.putString("pubsub#access_model", "open");
|
||||
return options;
|
||||
}
|
||||
|
||||
public static Bundle persistentWhitelistAccess() {
|
||||
final Bundle options = new Bundle();
|
||||
options.putString("pubsub#persist_items","true");
|
||||
options.putString("pubsub#access_model","whitelist");
|
||||
options.putString("pubsub#persist_items", "true");
|
||||
options.putString("pubsub#access_model", "whitelist");
|
||||
return options;
|
||||
}
|
||||
|
||||
public static Bundle persistentWhitelistAccessMaxItems() {
|
||||
final Bundle options = new Bundle();
|
||||
options.putString("pubsub#persist_items", "true");
|
||||
options.putString("pubsub#access_model", "whitelist");
|
||||
options.putString("pubsub#send_last_published_item", "never");
|
||||
options.putString("pubsub#max_items", "128"); //YOLO!
|
||||
|
||||
options.putString("pubsub#notify_delete", "true");
|
||||
options.putString("pubsub#notify_retract", "true"); //one could also set notify=true on the retract
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
|
|
|
@ -337,6 +337,7 @@
|
|||
<string name="x_file_offered_for_download">%s zum Herunterladen angeboten</string>
|
||||
<string name="cancel_transmission">Übertragung abbrechen</string>
|
||||
<string name="file_transmission_failed">Übertragung fehlgeschlagen</string>
|
||||
<string name="file_transmission_cancelled">Übertragung abgebrochen</string>
|
||||
<string name="file_deleted">Datei wurde gelöscht</string>
|
||||
<string name="no_application_found_to_open_file">Keine Anwendung zum Öffnen der Datei gefunden</string>
|
||||
<string name="no_application_found_to_open_link">Keine Anwendung zum Öffnen des Links gefunden</string>
|
||||
|
@ -857,7 +858,7 @@
|
|||
<string name="discover_channels">Channels entdecken</string>
|
||||
<string name="search_channels">Channels suchen</string>
|
||||
<string name="channel_discovery_opt_in_title">Mögliche Datenschutzverletzung!</string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[Die Channel-Entdeckung verwendet einen Drittanbieterservice namens <a href="https://search.jabbercat.org">search.jabbercat.org</a>.<br><br>Wenn du diese Funktion verwendest, werden deine IP-Adresse und deine Suchbegriffe an diesen Dienst übertragen. Weitere Informationen findest du in der <a href="https://search.jabbercat.org/privacy">Datenschutzerklärung</a>.]]></string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[Die Channel-Entdeckung verwendet einen Drittanbieterservice namens <a href="https://search.jabber.network">search.jabber.network</a>.<br><br>Wenn du diese Funktion verwendest, werden deine IP-Adresse und deine Suchbegriffe an diesen Dienst übertragen. Weitere Informationen findest du in der <a href="https://search.jabber.network/privacy">Datenschutzerklärung</a>.]]></string>
|
||||
<string name="i_already_have_an_account">Ich habe bereits ein Konto</string>
|
||||
<string name="add_existing_account">Vorhandenes Konto hinzufügen</string>
|
||||
<string name="register_new_account">Neues Konto erstellen</string>
|
||||
|
|
|
@ -857,7 +857,6 @@
|
|||
<string name="discover_channels">Ανακάλυψη καναλιών</string>
|
||||
<string name="search_channels">Αναζήτηση καναλιών</string>
|
||||
<string name="channel_discovery_opt_in_title">Πιθανή παραβίαση ιδιωτικότητας!</string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[Η ανακάλυψη καναλιού χρησιμοποιεί μια τρίτη υπηρεσία που λέγεται <a href="https://search.jabbercat.org">search.jabbercat.org</a>.<br><br>Χρησιμοποιώντας αυτή τη λειτουργία θα μεταβιβαστεί η διεύθυνση IP σας και οι όροι αναζήτησης σε αυτή την υπηρεσία. Δείτε την <a href="https://search.jabbercat.org/privacy">Πολιτική Ιδιωτικότητας</a> της για περισσότερες πληροφορίες.]]></string>
|
||||
<string name="i_already_have_an_account">Έχω ήδη λογαριασμό</string>
|
||||
<string name="add_existing_account">Προσθήκη υπάρχοντος λογαριασμού</string>
|
||||
<string name="register_new_account">Εγγραφή νέου λογαριασμού</string>
|
||||
|
|
|
@ -857,7 +857,6 @@
|
|||
<string name="discover_channels">Descubrir canales</string>
|
||||
<string name="search_channels">Buscar canales</string>
|
||||
<string name="channel_discovery_opt_in_title">¡Posible violación de privacidad!</string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[La búsqueda de canales usa un servicio de terceros llamado search.jabbercat.org<a href="https://search.jabbercat.org">. <br><br>Usando esta funcionalidad transmitirás tu dirección IP y los términos buscados a este servicio. Ver su <a href="https://search.jabbercat.org/privacy">Política de Privacidad</a> para más información.]]></string>
|
||||
<string name="i_already_have_an_account">Ya tengo una cuenta</string>
|
||||
<string name="add_existing_account">Añadir una cuenta existente</string>
|
||||
<string name="register_new_account">Registrar una cuenta nueva</string>
|
||||
|
@ -872,4 +871,5 @@
|
|||
<string name="account_already_setup">Esta cuenta ya fue configurada</string>
|
||||
<string name="please_enter_password">Por favor ingrese la contraseña para esta cuenta</string>
|
||||
<string name="unable_to_perform_this_action">No se ha podido realizar esta acción</string>
|
||||
<string name="open_join_dialog">Unirse a canal público...</string>
|
||||
</resources>
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
<string name="just_now">orain</string>
|
||||
<string name="minute_ago">min 1 lehenago</string>
|
||||
<string name="minutes_ago">%d min lehenago</string>
|
||||
<string name="x_unread_conversations">Irakurrik gabeko %d elkarrizketa</string>
|
||||
<string name="sending">bidaltzen…</string>
|
||||
<string name="message_decrypting">Mezua desenkriptatzen. Mesedez itxaron…</string>
|
||||
<string name="pgp_message">OpenPGPz enkriptatutako mezua</string>
|
||||
|
@ -336,6 +337,7 @@
|
|||
<string name="x_file_offered_for_download">%s deskargatzeko eskeinita</string>
|
||||
<string name="cancel_transmission">Transmisioa utzi</string>
|
||||
<string name="file_transmission_failed">fitxategi transmisioak huts egin du</string>
|
||||
<string name="file_transmission_cancelled">fitxategiaren transmisioa utzi egin da</string>
|
||||
<string name="file_deleted">Fitxategia ezabatu egin da</string>
|
||||
<string name="no_application_found_to_open_file">Fitxategia ireki dezakeen aplikaziorik ez da aurkitu</string>
|
||||
<string name="no_application_found_to_open_link">Ez da lotura hau ireki dezakeen aplikaziorik aurkitu</string>
|
||||
|
@ -854,7 +856,7 @@
|
|||
<string name="discover_channels">Kanalak aurkitu</string>
|
||||
<string name="search_channels">Kanalak bilatu</string>
|
||||
<string name="channel_discovery_opt_in_title">Balizko pribatutasun urraketa!</string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[Kanalak aurkitzeko ezaugarriak <a href="https://search.jabbercat.org">search.jabbercat.org</a> izeneko hirugarren zerbitzu bat erabiltzen du.<br><br>Ezaugarri hau erabiltzeak zure IP helbidea eta bilatutako testua zerbitzu horretara bidaltzea dakar. Ikusi beren <a href="https://search.jabbercat.org/privacy">pribatutasun politika</a> informazio gehiago lortzeko.]]></string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[Kanalak aurkitzeko ezaugarriak <a href="https://search.jabber.network">search.jabber.network</a>. izeneko hirugarren zerbitzu bat erabiltzen du.<br><br>Ezaugarri hau erabiltzeak zure IP helbidea eta bilatutako testua zerbitzu horretara bidaltzea dakar. Ikusi beren <a href="https://search.jabber.network/privacy">pribatutasun politika</a> informazio gehiago lortzeko.]]></string>
|
||||
<string name="i_already_have_an_account">Badaukat kontu bat dagoeneko</string>
|
||||
<string name="add_existing_account">Gehitu existitzen den kontu bat</string>
|
||||
<string name="register_new_account">Kontu berria erregistratu</string>
|
||||
|
@ -868,4 +870,6 @@
|
|||
<string name="not_a_backup_file">Hautatu duzun fitxategia ez da Conversations babes-kopia bat</string>
|
||||
<string name="account_already_setup">Kontu hau konfiguratuta dago jada</string>
|
||||
<string name="please_enter_password">Mesedez idatzi ezazu kontu honetarako pasahitza</string>
|
||||
<string name="unable_to_perform_this_action">Ezin izan da ekintza hau burutu</string>
|
||||
<string name="open_join_dialog">Kanal publiko batean sartu…</string>
|
||||
</resources>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<string name="action_end_conversation">Fermer cette conversation</string>
|
||||
<string name="action_contact_details">Détails du contact</string>
|
||||
<string name="action_muc_details">Détails de la conversation de groupe</string>
|
||||
<string name="channel_details">Détails de la chaîne</string>
|
||||
<string name="channel_details">Détails du canal</string>
|
||||
<string name="action_secure">Conversation sécurisée</string>
|
||||
<string name="action_add_account">Ajouter un compte</string>
|
||||
<string name="action_edit_contact">Modifier le nom</string>
|
||||
|
@ -17,6 +17,8 @@
|
|||
<string name="action_unblock_contact">Débloquer le contact</string>
|
||||
<string name="action_block_domain">Bloquer le domaine</string>
|
||||
<string name="action_unblock_domain">Débloquer le domaine</string>
|
||||
<string name="action_block_participant">Bloquer le participant</string>
|
||||
<string name="action_unblock_participant">Débloquer le participant</string>
|
||||
<string name="title_activity_manage_accounts">Gestion des comptes</string>
|
||||
<string name="title_activity_settings">Paramètres</string>
|
||||
<string name="title_activity_sharewith">Partager avec Conversation</string>
|
||||
|
@ -28,6 +30,7 @@
|
|||
<string name="just_now">À l\'instant</string>
|
||||
<string name="minute_ago">Il y a 1 minute</string>
|
||||
<string name="minutes_ago">Il y a %d minutes</string>
|
||||
<string name="x_unread_conversations">%d conversations non lues</string>
|
||||
<string name="sending">Envoi…</string>
|
||||
<string name="message_decrypting">Déchiffrement du message. Veuillez patienter...</string>
|
||||
<string name="pgp_message">Message chiffré avec OpenPGP</string>
|
||||
|
@ -334,6 +337,7 @@
|
|||
<string name="x_file_offered_for_download">%s proposé à télécharger</string>
|
||||
<string name="cancel_transmission">Annuler l\'envoi</string>
|
||||
<string name="file_transmission_failed">Échec de l\'envoi du fichier</string>
|
||||
<string name="file_transmission_cancelled">Transfert de fichier annulé</string>
|
||||
<string name="file_deleted">Le fichier a été supprimé</string>
|
||||
<string name="no_application_found_to_open_file">Aucune application disponible pour ouvrir le fichier</string>
|
||||
<string name="no_application_found_to_open_link">Aucune application trouvée pour ouvrir le lien</string>
|
||||
|
@ -701,7 +705,7 @@
|
|||
<string name="small">Petite</string>
|
||||
<string name="medium">Moyenne</string>
|
||||
<string name="large">Grande</string>
|
||||
<string name="not_encrypted_for_this_device">OMEMO sera utilisé par défaut pour toute nouvelle conversation.</string>
|
||||
<string name="not_encrypted_for_this_device">Le message n\'était pas chiffré pour cet appareil.</string>
|
||||
<string name="omemo_decryption_failed">Échec de déchiffrement du message OMEMO.</string>
|
||||
<string name="undo">annuler</string>
|
||||
<string name="location_disabled">Le partage de positionnement est désactivé.</string>
|
||||
|
@ -845,7 +849,7 @@
|
|||
<string name="anyone_can_invite_others">N\'importe qui peut inviter d\'autres personnes.</string>
|
||||
<string name="jabber_ids_are_visible_to_admins">Les adresses XMPP sont visibles par les administrateurs.</string>
|
||||
<string name="jabber_ids_are_visible_to_anyone">Les adresses XMPP sont visibles par tous.</string>
|
||||
<string name="no_users_hint_channel">Cette chaîne publique n\'a pas de participants. Invitez vos contacts ou utilisez le bouton de partage pour distribuer son adresse XMPP.</string>
|
||||
<string name="no_users_hint_channel">Ce canal publique n\'a pas de participants. Invitez vos contacts ou utilisez le bouton de partage pour distribuer son adresse XMPP.</string>
|
||||
<string name="no_users_hint_group_chat">Ce chat de groupe privé n\'a aucun participant.</string>
|
||||
<string name="manage_permission">Gérer les privilèges</string>
|
||||
<string name="search_participants">Rechercher des participants</string>
|
||||
|
@ -854,11 +858,20 @@
|
|||
<string name="discover_channels">Découverte des canaux</string>
|
||||
<string name="search_channels">Recherche des canaux</string>
|
||||
<string name="channel_discovery_opt_in_title">Violation possible de la confidentialité !</string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[La découverte de chaînes utilise un service tiers appelé <a href="https://search.jabbercat.org">search.jabbercat.org</a> qui transmet votre adresse IP et les termes de recherche à ce service. Voir leur <a href="https://search.jabbercat.org/privacy">politique de confidentialité</a> pour plus d\'informations]]>.</string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[Channel discovery utilise un service tiers appelé <a href="https://search.jabber.network">search.jabber.network</a>.<br><br>L\'utilisation de cette fonction transmettra votre adresse IP et les termes de recherche à ce service. Veuillez consulter leur <a href="https://search.jabber.network/privacy">Politique de confidentialité</a> pour plus d\'information.]]></string>
|
||||
<string name="i_already_have_an_account">J\'ai déjà un compte</string>
|
||||
<string name="add_existing_account">Ajouter un compte existant</string>
|
||||
<string name="register_new_account">Enregistrer un nouveau compte</string>
|
||||
<string name="this_looks_like_a_domain">Ceci ressemble à une adresse de domaine</string>
|
||||
<string name="add_anway">Ajouter quand même</string>
|
||||
<string name="this_looks_like_channel">Ceci ressemble à une adresse de canal</string>
|
||||
<string name="share_backup_files">Partager les fichiers de sauvegardes</string>
|
||||
<string name="conversations_backup">Sauvegarder les conversations</string>
|
||||
<string name="event">Événement </string>
|
||||
<string name="open_backup">Ouvrir sauvegarde</string>
|
||||
<string name="not_a_backup_file">Le fichier sélectionné n\'est pas une sauvegarde de Conversations</string>
|
||||
<string name="account_already_setup">Ce compte a déjà été configuré</string>
|
||||
<string name="please_enter_password">Veuillez saisir le mot de passe pour ce compte</string>
|
||||
<string name="unable_to_perform_this_action">Action impossible à réaliser</string>
|
||||
<string name="open_join_dialog">Rejoindre le canal public ...</string>
|
||||
</resources>
|
||||
|
|
|
@ -857,7 +857,6 @@
|
|||
<string name="discover_channels">Descubrir canales</string>
|
||||
<string name="search_channels">Buscar canales</string>
|
||||
<string name="channel_discovery_opt_in_title">Posible intrusión na intimidade!</string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[O descubrimento de canales utiliza un servizo de terceiros chamado <a href="https://search.jabbercat.org">search.jabbercat.org</a>.<br><br>Ao utilizar esta característica transmitirá o seu enderezo IP e os termos de busca a ese servizo. Lea a súa <a href="https://search.jabbercat.org/privacy">Política de Intimidade</a> para máis información.]]></string>
|
||||
<string name="i_already_have_an_account">Xa teño unha conta</string>
|
||||
<string name="add_existing_account">Engadir conta existente</string>
|
||||
<string name="register_new_account">Rexistrar unha nova conta</string>
|
||||
|
|
|
@ -856,7 +856,6 @@
|
|||
<string name="discover_channels">Csatornák felderítése</string>
|
||||
<string name="search_channels">Csatornák keresése</string>
|
||||
<string name="channel_discovery_opt_in_title">Magánélet lehetséges megsértése!</string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[A csatorna felderítés egy harmadik fél által biztosított szolgáltatást használ: <a href="https://search.jabbercat.org">search.jabbercat.org</a>.<br><br>Ezen funkció használata során át fog kerülni az IP címe és a keresési kifejezés ahhoz a szolgáltatáshoz. További információért tekintse meg az <a href="https://search.jabbercat.org/privacy">Adatvédelmi Irányelveiket</a>.]]></string>
|
||||
<string name="i_already_have_an_account">Már rendelkezem fiókkal</string>
|
||||
<string name="add_existing_account">Már létező fiók hozzáadása</string>
|
||||
<string name="register_new_account">Új fiók létrehozása</string>
|
||||
|
|
|
@ -857,7 +857,6 @@
|
|||
<string name="discover_channels">Individua i canali</string>
|
||||
<string name="search_channels">Cerca i canali</string>
|
||||
<string name="channel_discovery_opt_in_title">Possibile violazione della privacy!</string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[La ricerca dei canali usa un servizio di terze parti chiamato <a href="https://search.jabbercat.org">search.jabbercat.org</a>.<br><br>Usando questa opzione trasmetterai il tuo indirizzo IP e la stringa di ricerca al servizio. Controlla la loro <a href="https://search.jabbercat.org/privacy">Policy per la privacy</a> per maggiori informazioni.]]></string>
|
||||
<string name="i_already_have_an_account">Ho già un account</string>
|
||||
<string name="add_existing_account">Aggiungi un account pre-esistente</string>
|
||||
<string name="register_new_account">Registra un nuovo account</string>
|
||||
|
|
|
@ -337,6 +337,7 @@
|
|||
<string name="x_file_offered_for_download">%s aangeboden om te downloaden</string>
|
||||
<string name="cancel_transmission">Bestandsoverdracht annuleren</string>
|
||||
<string name="file_transmission_failed">bestandsoverdracht mislukt</string>
|
||||
<string name="file_transmission_cancelled">bestandsoverdracht geannuleerd</string>
|
||||
<string name="file_deleted">Het bestand is verwijderd</string>
|
||||
<string name="no_application_found_to_open_file">Geen applicatie om bestand te openen</string>
|
||||
<string name="no_application_found_to_open_link">Geen applicatie om verwijzing te openen</string>
|
||||
|
@ -856,7 +857,7 @@
|
|||
<string name="discover_channels">Kanalen ontdekken</string>
|
||||
<string name="search_channels">Kanalen doorzoeken</string>
|
||||
<string name="channel_discovery_opt_in_title">Mogelijke privacyschending!</string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[Kanaalontdekking maakt gebruik van een derdepartijdienst genaamd <a href="https://search.jabbercat.org">search.jabbercat.org</a>.<br><br>Door deze functie te gebruiken, zullen je IP-adres en zoekopdrachten naar die dienst verstuurd worden. Bekijk hun <a href="https://search.jabbercat.org/privacy">privacybeleid</a> voor meer informatie.]]></string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[Kanaalontdekking maakt gebruik van een derdepartijdienst genaamd <a href="https://search.jabber.network">search.jabber.network</a>.<br><br>Door deze functie te gebruiken, zullen je IP-adres en zoekopdrachten naar die dienst verstuurd worden. Bekijk hun <a href="https://search.jabber.network/privacy">privacybeleid</a> voor meer informatie.]]></string>
|
||||
<string name="i_already_have_an_account">Ik heb al een account</string>
|
||||
<string name="add_existing_account">Bestaande account toevoegen</string>
|
||||
<string name="register_new_account">Nieuwe account registreren</string>
|
||||
|
@ -871,4 +872,5 @@
|
|||
<string name="account_already_setup">Deze account is al ingesteld</string>
|
||||
<string name="please_enter_password">Voer het wachtwoord voor deze account in</string>
|
||||
<string name="unable_to_perform_this_action">Kan deze actie niet uitvoeren</string>
|
||||
<string name="open_join_dialog">Deelnemen aan openbaar kanaal…</string>
|
||||
</resources>
|
||||
|
|
|
@ -874,7 +874,6 @@ Administrator twojego serwera będzie mógł czytać twoje wiadomości, ale moż
|
|||
<string name="discover_channels">Odkryj kanały</string>
|
||||
<string name="search_channels">Wyszukaj kanał</string>
|
||||
<string name="channel_discovery_opt_in_title">Możliwe naruszenie prywatności!</string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[Odkrywanie kanałów używa usługi firmy trzeciej <a href="https://search.jabbercat.org">search.jabbercat.org</a>. <br><br>Używając tej funkcji twój adres IP oraz kryteria wyszukiwania zostaną wysłane do tej usługi. Sprawdź <a href="https://search.jabbercat.org/privacy">Politykę Prywatności</a> aby uzyskać więcej informacji.]]></string>
|
||||
<string name="i_already_have_an_account">Już mam konto</string>
|
||||
<string name="add_existing_account">Dodaj istniejące konto</string>
|
||||
<string name="register_new_account">Zarejestruj nowe konto</string>
|
||||
|
|
|
@ -856,7 +856,6 @@
|
|||
<string name="discover_channels">Descobrir canais</string>
|
||||
<string name="search_channels">Pesquisar canais</string>
|
||||
<string name="channel_discovery_opt_in_title">Provável violação de privacidade!</string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[A descoberta de canais utiliza um serviço de terceiros chamado <a href="https://search.jabbercat.org">search.jabbercat.org</a>.<br><br>Ao usar esse recurso, você enviará o seu endereço IP e termos de pesquisa para esse serviço. Veja sua <a href="https://search.jabbercat.org/privacy">Política de Privacidade</a> para maiores informações.]]></string>
|
||||
<string name="i_already_have_an_account">Eu já tenho uma conta.</string>
|
||||
<string name="add_existing_account">Adicionar uma conta já existente</string>
|
||||
<string name="register_new_account">Registrar uma nova conta</string>
|
||||
|
|
|
@ -337,6 +337,7 @@
|
|||
<string name="x_file_offered_for_download">%s - fișier oferit spre descărcare</string>
|
||||
<string name="cancel_transmission">Anulează transmisiunea</string>
|
||||
<string name="file_transmission_failed">transmisie fișier eșuată</string>
|
||||
<string name="file_transmission_cancelled">transmisia fișierului a fost anulată</string>
|
||||
<string name="file_deleted">Fișierul a fost șters</string>
|
||||
<string name="no_application_found_to_open_file">Nu s-a găsit nici o aplicație care să deschidă fișierul</string>
|
||||
<string name="no_application_found_to_open_link">Nu s-a găsit nici o aplicație care să deschidă legătura</string>
|
||||
|
@ -866,7 +867,7 @@ sau chiar pierderea mesajelor.\nÎn continuare veți fi rugați să dezactivați
|
|||
<string name="discover_channels">Descoperă canale publice</string>
|
||||
<string name="search_channels">Caută canale publice</string>
|
||||
<string name="channel_discovery_opt_in_title">Posibilă încălcare a intimității!</string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[Descoperirea de canale publice folosește un serviciu terț numit <a href="https://search.jabbercat.org">search.jabbercat.org</a>.<br><br>Folosind această funcție se va transmite adresa dumneavoastră IP și cuvintele căutate către acest serviciu. Pentru mai multe informații citiți <a href="https://search.jabbercat.org/privacy">Politica de confidențialitate</a> a serviciului.]]></string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[Descoperirea de canale publice folosește un serviciu terț numit <a href="https://search.jabber.network">search.jabber.network</a>.<br><br>Folosind această funcție se va transmite adresa dumneavoastră IP și cuvintele căutate către acest serviciu. Pentru mai multe informații citiți <a href="https://search.jabber.network/privacy">Politica de confidențialitate</a> a serviciului.]]></string>
|
||||
<string name="i_already_have_an_account">Eu am deja un cont</string>
|
||||
<string name="add_existing_account">Adaugă un cont existent</string>
|
||||
<string name="register_new_account">Înregistrează un cont nou</string>
|
||||
|
|
|
@ -871,7 +871,6 @@
|
|||
<string name="discover_channels">Знайти канали</string>
|
||||
<string name="search_channels">Шукати канали</string>
|
||||
<string name="channel_discovery_opt_in_title">Можливе порушення приватності!</string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[Пошук каналів використовує сторонній сервіс з назвою <a href="https://search.jabbercat.org">search.jabbercat.org</a>.<br><br>Використання цієї функції передає Вашу IP адресу та пошукові запити цьому сервісу. Перегляньте їхню <a href="https://search.jabbercat.org/privacy">політику конфіденційності</a>, щоб отримати більше інформації.]]></string>
|
||||
<string name="i_already_have_an_account">Я вже маю обліковий запис</string>
|
||||
<string name="add_existing_account">Додати наявний обліковий запис</string>
|
||||
<string name="register_new_account">Зареєструвати новий обліковий запис</string>
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="ConversationsTheme.Dark" parent="ConversationsTheme.Dark.Base">
|
||||
<item name="android:navigationBarColor">@color/black</item>
|
||||
</style>
|
||||
</resources>
|
|
@ -850,7 +850,6 @@
|
|||
<string name="discover_channels">发现群聊</string>
|
||||
<string name="search_channels">搜索群聊</string>
|
||||
<string name="channel_discovery_opt_in_title">可能侵犯隐私!</string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[探索群聊功能使用一个叫<a href="https://search.jabbercat.org">search.jabbercat.org</a>的第三方服务。在探索群聊时,您的IP地址和搜索内容将传送到他们的服务器上。有关更多信息,请参阅他们的<a href="https://search.jabbercat.org/privacy">隐私政策</a>。]]></string>
|
||||
<string name="i_already_have_an_account">我已有账户</string>
|
||||
<string name="add_existing_account">添加已有账户</string>
|
||||
<string name="register_new_account">注册新账户</string>
|
||||
|
|
|
@ -337,6 +337,7 @@
|
|||
<string name="x_file_offered_for_download">%s offered for download</string>
|
||||
<string name="cancel_transmission">Cancel transmission</string>
|
||||
<string name="file_transmission_failed">file transmission failed</string>
|
||||
<string name="file_transmission_cancelled">file transmission cancelled</string>
|
||||
<string name="file_deleted">The file has been deleted</string>
|
||||
<string name="no_application_found_to_open_file">No application found to open file</string>
|
||||
<string name="no_application_found_to_open_link">No application found to open link</string>
|
||||
|
@ -859,7 +860,7 @@
|
|||
<string name="discover_channels">Discover channels</string>
|
||||
<string name="search_channels">Search channels</string>
|
||||
<string name="channel_discovery_opt_in_title">Possible privacy violation!</string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[Channel discovery uses a third party service called <a href="https://search.jabbercat.org">search.jabbercat.org</a>.<br><br>Using this feature will transmit your IP address and search terms to that service. See their <a href="https://search.jabbercat.org/privacy">Privacy Policy</a> for more information.]]></string>
|
||||
<string name="channel_discover_opt_in_message"><![CDATA[Channel discovery uses a third party service called <a href="https://search.jabber.network">search.jabber.network</a>.<br><br>Using this feature will transmit your IP address and search terms to that service. See their <a href="https://search.jabber.network/privacy">Privacy Policy</a> for more information.]]></string>
|
||||
<string name="i_already_have_an_account">I already have an account</string>
|
||||
<string name="add_existing_account">Add existing account</string>
|
||||
<string name="register_new_account">Register new account</string>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="ConversationsTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/orange600</item>
|
||||
|
@ -114,13 +114,12 @@
|
|||
<item type="reference" name="icon_enable_undecided_device">@drawable/ic_new_releases_black_24dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationsTheme.Dark" parent="ConversationsTheme.Dark.Base" />
|
||||
|
||||
<style name="ConversationsTheme.Dark.Base" parent="Theme.AppCompat.NoActionBar">
|
||||
<style name="ConversationsTheme.Dark" parent="Theme.AppCompat.NoActionBar">
|
||||
<item name="colorPrimary">@color/orange800</item>
|
||||
<item name="colorPrimaryDark">@color/orange900</item>
|
||||
<item name="colorAccent">@color/blue_a100</item>
|
||||
<item name="popupOverlayStyle">@style/ThemeOverlay.AppCompat.Dark</item>
|
||||
<item name="android:navigationBarColor" tools:targetApi="21">@color/black</item>
|
||||
|
||||
<item name="color_background_primary">@color/black</item>
|
||||
<item name="color_background_secondary">@color/black</item>
|
||||
|
@ -281,6 +280,7 @@
|
|||
<item name="android:windowFullscreen">true</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowBackground">@android:color/black</item>
|
||||
<item name="android:navigationBarColor" tools:targetApi="21">@color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
|
||||
|
|
|
@ -19,4 +19,8 @@
|
|||
<string name="no_microphone_permission">Quicksy doit avoir accès au microphone</string>
|
||||
<string name="foreground_service_channel_description">Cette catégorie de notification est utilisée pour afficher une notification permanente indiquant que Quicksy est en cours d\'exécution.</string>
|
||||
<string name="set_profile_picture">Photo de profil Quicksy</string>
|
||||
</resources>
|
||||
<string name="not_available_in_your_country">Quicksy n\'est pas disponible dans votre pays.</string>
|
||||
<string name="unable_to_verify_server_identity">Vérification de l\'identité du serveur impossible.</string>
|
||||
<string name="unknown_security_error">Erreur de sécurité inconnue.</string>
|
||||
<string name="timeout_while_connecting_to_server">Timeout lors de la connexion au serveur.</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in New Issue