aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2020-04-10 17:41:58 +0200
committersteckbrief <steckbrief@chefmail.de>2020-04-10 17:41:58 +0200
commit20501a168c10aa994a3ecfac96e395291079d1cf (patch)
tree5c4594fcdfccebbb606fe83c6d03030e21ee9192
parent65ed07ffa90b9a02b957eea6a48bf64509535ce7 (diff)
relates to FS#299: Changes URL to staticmap for generating location map image to piratx.thedevstack.de, moves definition of invite host url and url to staticmap to build config
-rw-r--r--build.gradle3
-rw-r--r--src/main/java/de/pixart/messenger/Config.java2
-rw-r--r--src/main/java/de/pixart/messenger/utils/GeoHelper.java4
3 files changed, 7 insertions, 2 deletions
diff --git a/build.gradle b/build.gradle
index 207c73710..936ce7e9b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -107,6 +107,9 @@ android {
applicationId appId
multiDexEnabled true
resValue "string", "applicationId", applicationId
+
+ buildConfigField 'String', 'STATICMAP_URL', '"https://piratx.thedevstack.de/staticmap"'
+ buildConfigField 'String', 'INVITE_HOST', '"jabber.thedevstack.de"'
}
dataBinding {
diff --git a/src/main/java/de/pixart/messenger/Config.java b/src/main/java/de/pixart/messenger/Config.java
index 2c853002b..a9fef89c7 100644
--- a/src/main/java/de/pixart/messenger/Config.java
+++ b/src/main/java/de/pixart/messenger/Config.java
@@ -45,7 +45,7 @@ public final class Config {
public static final Jid BUG_REPORTS = Jid.of("piratx+bugs@conference.thedevstack.de");
public static final String inviteUrlScheme = "https";
- public static final String inviteHostURL = "jabber.thedevstack.de"; // without http(s)
+ public static final String inviteHostURL = BuildConfig.INVITE_HOST; // without http(s)
public static final String inviteUserURL = inviteUrlScheme + "://" + inviteHostURL + "/i/";
public static final String inviteMUCURL = inviteUrlScheme + "://" + inviteHostURL + "/j/";
diff --git a/src/main/java/de/pixart/messenger/utils/GeoHelper.java b/src/main/java/de/pixart/messenger/utils/GeoHelper.java
index 87620ee8b..22469e021 100644
--- a/src/main/java/de/pixart/messenger/utils/GeoHelper.java
+++ b/src/main/java/de/pixart/messenger/utils/GeoHelper.java
@@ -12,6 +12,7 @@ import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import de.pixart.messenger.BuildConfig;
import de.pixart.messenger.Config;
import de.pixart.messenger.R;
import de.pixart.messenger.entities.Contact;
@@ -42,7 +43,8 @@ public class GeoHelper {
} catch (NumberFormatException nfe) {
return null;
}
- return "https://xmpp.pix-art.de/staticmap/staticmap.php?center=" + latitude + "," + longitude + "&size=500x500&markers=" + latitude + "," + longitude + "&zoom= " + Config.DEFAULT_ZOOM;
+
+ return BuildConfig.STATICMAP_URL + "?center=" + latitude + "," + longitude + "&size=500x500&markers=" + latitude + "," + longitude + "&zoom= " + Config.DEFAULT_ZOOM;
}
private static GeoPoint parseGeoPoint(String body) throws IllegalArgumentException {