Skip to content

Commit

Permalink
Merge branch 'hotfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
FranckRJ committed Jan 16, 2018
2 parents aa417b6 + 124e33a commit eef5277
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.franckrj.respawnirc"
minSdkVersion 15
targetSdkVersion 27
versionCode 1_009_2_001
versionName "1.9.1"
versionCode 1_009_2_002
versionName "1.9.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
resConfigs "fr"
}
Expand Down
17 changes: 16 additions & 1 deletion java/com/franckrj/respawnirc/ConnectActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
public class ConnectActivity extends AbsHomeIsBackActivity {
private static final long MAX_TIME_USER_HAVE_TO_LEAVE_IN_MS = 3_500;

private WebView jvcWebView = null;
private EditText pseudoText = null;
private HelpConnectDialogFragment helpDialogFragment = null;
private long lastTimeUserTryToLeaveInMs = -MAX_TIME_USER_HAVE_TO_LEAVE_IN_MS;
Expand Down Expand Up @@ -76,7 +77,7 @@ public void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_connect);
initToolbar(R.id.toolbar_connect);

WebView jvcWebView = findViewById(R.id.webview_connect);
jvcWebView = findViewById(R.id.webview_connect);
pseudoText = findViewById(R.id.pseudo_text_connect);

helpDialogFragment = new HelpConnectDialogFragment();
Expand All @@ -100,6 +101,20 @@ public void onCreate(Bundle savedInstanceState) {
PrefsManager.applyChanges();
}

@Override
public void onResume() {
super.onResume();
jvcWebView.resumeTimers();
jvcWebView.onResume();
}

@Override
public void onPause() {
jvcWebView.onPause();
jvcWebView.pauseTimers();
super.onPause();
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
Expand Down
14 changes: 14 additions & 0 deletions java/com/franckrj/respawnirc/WebBrowserActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,20 @@ public void onReceivedTitle(WebView view, String title) {
PrefsManager.applyChanges();
}

@Override
public void onResume() {
super.onResume();
browserWebView.resumeTimers();
browserWebView.onResume();
}

@Override
public void onPause() {
browserWebView.onPause();
browserWebView.pauseTimers();
super.onPause();
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
Expand Down
5 changes: 4 additions & 1 deletion java/com/franckrj/respawnirc/utils/JVCParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public final class JVCParser {
private static final Pattern ajaxSubHashPattern = Pattern.compile("<body *data-abo-session=\"([^\"]*)\">");
private static final Pattern messageQuotePattern = Pattern.compile("\"txt\":\"(.*)\"", Pattern.DOTALL);
private static final Pattern entireMessagePattern = Pattern.compile("(<div class=\"bloc-message-forum[^\"]*\".*?)(<span id=\"post_[^\"]*\" class=\"bloc-message-forum-anchor\">|<div class=\"bloc-outils-plus-modo bloc-outils-bottom\">|<div class=\"bloc-pagi-default\">)", Pattern.DOTALL);
private static final Pattern signaturePattern = Pattern.compile("<div class=\"signature-msg[^\"]*\">(.*?)</div>", Pattern.DOTALL);
private static final Pattern signaturePattern = Pattern.compile("<div class=\"signature-msg[^\"]*\">(.*)", Pattern.DOTALL);
private static final Pattern avatarPattern = Pattern.compile("<img src=\"[^\"]*\" data-srcset=\"(http:)?//([^\"]*)\" class=\"user-avatar-msg\"", Pattern.DOTALL);
private static final Pattern entireTopicPattern = Pattern.compile("<li class=\"[^\"]*\" data-id=\"[^\"]*\">.*?<span class=\"topic-subject\">.*?</li>", Pattern.DOTALL);
private static final Pattern pseudoIsBlacklistedPattern = Pattern.compile("<div class=\"bloc-message-forum msg-pseudo-blacklist[^\"]*\" data-id=\"");
Expand Down Expand Up @@ -86,6 +86,7 @@ public final class JVCParser {
private static final Pattern longLinkPattern = Pattern.compile("<span class=\"JvCare [^\"]*\"[^i]*itle=\"([^\"]*)\">[^<]*<i></i><span>[^<]*</span>[^<]*</span>");
private static final Pattern smileyPattern = Pattern.compile("<img src=\"http(s)?://image\\.jeuxvideo\\.com/smileys_img/([^\"]*)\" alt=\"[^\"]*\" data-code=\"([^\"]*)\" title=\"[^\"]*\" [^>]*>");
private static final Pattern youtubeVideoPattern = Pattern.compile("<div class=\"player-contenu\"><div class=\"[^\"]*\"><iframe .*? src=\"http(s)?://www\\.youtube\\.com/embed/([^\"]*)\"[^>]*></iframe></div></div>");
private static final Pattern jvcVideoPattern = Pattern.compile("<div class=\"player-contenu\">.*?</div>[^<]*</div>[^<]*</div>[^<]*</div>", Pattern.DOTALL);
private static final Pattern surroundedBlockquotePattern = Pattern.compile("(<br /> *)*(<(/)?blockquote>)( *<br />)*");
private static final Pattern noelshackImagePattern = Pattern.compile("<span class=\"JvCare[^>]*><img class=\"img-shack\".*?src=\"http(s)?://([^\"]*)\" alt=\"([^\"]*)\"[^>]*></span>");
private static final Pattern emptySearchPattern = Pattern.compile("<span style=\"[^\"]*\">[ \\n\\r]*Aucune réponse pour votre recherche ![ \\n\\r]*</span>");
Expand Down Expand Up @@ -885,6 +886,7 @@ public static String parseMessageToPrettyMessage(String messageInString, Setting
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, smileyPattern, 2, "<img src=\"smiley_", "\"/>", null, null);

ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, youtubeVideoPattern, 2, "<a href=\"http://youtu.be/", "\">http://youtu.be/", 2, "</a>");
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, jvcVideoPattern, -1, "[[Vidéo non supportée par l'application]]", "", null, null);
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, jvcLinkPattern, 1, "", "", makeLinkDependingOnSettingsAndForceMake, null);
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, shortLinkPattern, 1, "", "", makeLinkDependingOnSettingsAndForceMake, null);
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, longLinkPattern, 1, "", "", makeLinkDependingOnSettingsAndForceMake, null);
Expand Down Expand Up @@ -935,6 +937,7 @@ public static String parseMessageToSimpleMessage(String messageInString) {
ToolForParsing.replaceStringByAnother(messageInBuilder, "\n", "");
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, smileyPattern, 3, "", "", null, null);
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, youtubeVideoPattern, 2, "http://youtu.be/", "", null, null);
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, jvcVideoPattern, -1, "[[Vidéo non supportée par l'application]]", "", null, null);
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, jvcLinkPattern, 1, "", "", null, null);
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, shortLinkPattern, 1, "", "", null, null);
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, longLinkPattern, 1, "", "", null, null);
Expand Down

0 comments on commit eef5277

Please sign in to comment.