Using
<meta http-equiv="Refresh" content="1; URL=http://example.com/">
in a HTML message causes WebView to load the URL in the default browser.
Overriding WebViewClient.shouldOverrideUrlLoading() allows us to cancel
loading this URL. Sadly, I found no way to find out whether the method was
called because of a meta refresh or because the user clicked on a link.
So now we're using HtmlCleaner to parse the HTML and remove all "meta" elements
containing an "http-equiv" attribute with a value of "refresh".
We have been throwing away all attachments already, so it doesn't make
too much sense to keep local messages. And when we're not keeping local
messages we can remove all entries from the 'threads' table.
This change breaks all kinds of things, e.g.
- deleting messages
- updating messages
- downloading attachments
- deleting attachments
- searching in message bodies
946565347a passed 'this' to
getTextFromPart() which could be a multipart. This caused
all multipart messages to show 'No text' as the body.
Fix it by passing it the correct 'part' that was found.