aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/FbRegex.kt16
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/MessageParser.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/NotifParser.kt2
-rw-r--r--app/src/main/res/values/strings_no_translate.xml2
-rw-r--r--app/src/main/res/xml/frost_changelog.xml9
-rw-r--r--app/src/test/kotlin/android/util/Log.java3
7 files changed, 20 insertions, 16 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt
index 9db1747b..2261328d 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt
@@ -136,7 +136,7 @@ class AboutActivity : AboutActivityBase(null, {
val c = itemView.context
val size = c.dimenPixelSize(R.dimen.kau_avatar_bounds)
images = arrayOf<Pair<IIcon, () -> Unit>>(
- GoogleMaterial.Icon.gmd_star to { c.startLink(R.string.xda_labs_url) },
+ GoogleMaterial.Icon.gmd_arrow_downward to { c.startLink(R.string.github_downloads_url) },
CommunityMaterial.Icon.cmd_reddit to { c.startLink(R.string.reddit_url) },
CommunityMaterial.Icon.cmd_github_circle to { c.startLink(R.string.github_url) },
CommunityMaterial.Icon.cmd_slack to { c.startLink(R.string.slack_url) },
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbRegex.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbRegex.kt
index a57ced11..9b29d009 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbRegex.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbRegex.kt
@@ -18,15 +18,15 @@ val FB_REV_MATCHER: Regex by lazy { Regex("\"app_version\":\"(.*?)\"") }
/**
* Matches user id from cookie
*/
-val FB_USER_MATCHER: Regex by lazy { Regex("c_user=([0-9]*);") }
+val FB_USER_MATCHER: Regex = Regex("c_user=([0-9]*);")
-val FB_EPOCH_MATCHER: Regex by lazy { Regex(":([0-9]+)") }
-val FB_NOTIF_ID_MATCHER: Regex by lazy { Regex("notif_([0-9]+)") }
-val FB_MESSAGE_NOTIF_ID_MATCHER: Regex by lazy { Regex("(?:thread|user)_fbid_([0-9]+)") }
-val FB_CSS_URL_MATCHER: Regex by lazy { Regex("url\\([\"|']?(.*?)[\"|']?\\)") }
-val FB_JSON_URL_MATCHER: Regex by lazy { Regex("\"(http.*?)\"") }
-val FB_IMAGE_ID_MATCHER: Regex by lazy { Regex("fbcdn.*?/[0-9]+_([0-9]+)_") }
-val FB_REDIRECT_URL_MATCHER: Regex by lazy { Regex("url=(.*?fbcdn.*?)\"") }
+val FB_EPOCH_MATCHER: Regex = Regex(":([0-9]+)")
+val FB_NOTIF_ID_MATCHER: Regex = Regex("notif_([0-9]+)")
+val FB_MESSAGE_NOTIF_ID_MATCHER: Regex = Regex("(?:thread|user)_fbid_([0-9]+)")
+val FB_CSS_URL_MATCHER: Regex = Regex("url\\([\"|']?(.*?)[\"|']?\\)")
+val FB_JSON_URL_MATCHER: Regex = Regex("\"(http.*?)\"")
+val FB_IMAGE_ID_MATCHER: Regex = Regex("fbcdn.*?/[0-9]+_([0-9]+)_")
+val FB_REDIRECT_URL_MATCHER: Regex = Regex("url=(.*?fbcdn.*?)\"")
operator fun MatchResult?.get(groupIndex: Int) = this?.groupValues?.get(groupIndex)
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/MessageParser.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/MessageParser.kt
index a3ebf998..27b731bc 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/MessageParser.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/MessageParser.kt
@@ -92,7 +92,7 @@ private class MessageParserImpl : FrostParserBase<FrostMessages>(true) {
override fun parseImpl(doc: Document): FrostMessages? {
val threadList = doc.getElementById("threadlist_rows") ?: return null
- val threads: List<FrostThread> = threadList.getElementsByAttributeValueContaining("id", "thread_fbid_")
+ val threads: List<FrostThread> = threadList.getElementsByAttributeValueMatching("id", ".*${FB_MESSAGE_NOTIF_ID_MATCHER.pattern}.*")
.mapNotNull(this::parseMessage)
val seeMore = parseLink(doc.getElementById("see_older_threads"))
val extraLinks = threadList.nextElementSibling().select("a")
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/NotifParser.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/NotifParser.kt
index 410a0e84..8aa8e706 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/NotifParser.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/NotifParser.kt
@@ -67,7 +67,7 @@ private class NotifParserImpl : FrostParserBase<FrostNotifs>(false) {
override fun parseImpl(doc: Document): FrostNotifs? {
val notificationList = doc.getElementById("notifications_list") ?: return null
val notifications = notificationList
- .getElementsByAttributeValueContaining("id", "list_notif_")
+ .getElementsByAttributeValueMatching("id", ".*${FB_NOTIF_ID_MATCHER.pattern}.*")
.mapNotNull(this::parseNotif)
val seeMore = parseLink(doc.getElementsByAttributeValue("href", "/notifications.php?more").first())
return FrostNotifs(notifications, seeMore)
diff --git a/app/src/main/res/values/strings_no_translate.xml b/app/src/main/res/values/strings_no_translate.xml
index 7805aac1..9eb85dc2 100644
--- a/app/src/main/res/values/strings_no_translate.xml
+++ b/app/src/main/res/values/strings_no_translate.xml
@@ -5,10 +5,10 @@
<string name="paypal" translatable="false">PayPal</string>
<string name="translation_url" translatable="false">https://crwd.in/frost-for-facebook</string>
<string name="github_url" translatable="false">https://github.com/AllanWang/Frost-for-Facebook</string>
+ <string name="github_downloads_url" translatable="false">https://github.com/AllanWang/Frost-for-Facebook/releases</string>
<string name="reddit_url" translatable="false">https://www.reddit.com/r/FrostForFacebook</string>
<string name="slack_url" translatable="false">https://frost-slack.allanwang.ca</string>
<string name="xda_url" translatable="false">https://forum.xda-developers.com/android/apps-games/app-frost-facebook-t3685896</string>
- <string name="xda_labs_url" translatable="false">https://labs.xda-developers.com/store/app/com.pitchedapps.frost</string>
<string name="frost_prefix" translatable="false">Frost for Facebook:</string>
<string name="feedback" translatable="false">Feedback</string>
<string name="bug_report" translatable="false">Bug Report</string>
diff --git a/app/src/main/res/xml/frost_changelog.xml b/app/src/main/res/xml/frost_changelog.xml
index 8182cbdc..5f047b35 100644
--- a/app/src/main/res/xml/frost_changelog.xml
+++ b/app/src/main/res/xml/frost_changelog.xml
@@ -6,13 +6,16 @@
<item text="" />
-->
- <version title="v2.1.1" />
- <item text="Fix link loading for some notifications. Some will redirect to the main notification page" />
- <item text="Fix double back click problem" />
+ <version title="v2.1.2" />
+ <item text="Fix message notifications with just one other user" />
<item text="" />
<item text="" />
<item text="" />
+ <version title="v2.1.1" />
+ <item text="Fix link loading for some notifications. Some will redirect to the main notification page" />
+ <item text="Fix double back click problem" />
+
<version title="v2.1.0" />
<item text="Changed signing key; requires clean install" />
<item text="Update lots of theme components" />
diff --git a/app/src/test/kotlin/android/util/Log.java b/app/src/test/kotlin/android/util/Log.java
index a2f431ed..9ac82a20 100644
--- a/app/src/test/kotlin/android/util/Log.java
+++ b/app/src/test/kotlin/android/util/Log.java
@@ -35,7 +35,8 @@ public class Log {
public static int println(int priority, String tag, String msg) {
switch (priority) {
case VERBOSE:
- p("V", tag, msg);
+ // Ignore verbose logging
+ // p("V", tag, msg);
break;
case INFO:
p("I", tag, msg);