mirror of
https://github.com/accelforce/Yuito
synced 2025-01-20 11:18:35 +01:00
fix notifications showing unparsed html (#2436)
This commit is contained in:
parent
3e849244f9
commit
027b659d1c
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.keylesspalace.tusky.components.notifications;
|
package com.keylesspalace.tusky.components.notifications;
|
||||||
|
|
||||||
|
import static com.keylesspalace.tusky.util.StatusParsingHelper.parseAsMastodonHtml;
|
||||||
import static com.keylesspalace.tusky.viewdata.PollViewDataKt.buildDescription;
|
import static com.keylesspalace.tusky.viewdata.PollViewDataKt.buildDescription;
|
||||||
|
|
||||||
import android.app.NotificationChannel;
|
import android.app.NotificationChannel;
|
||||||
@ -341,7 +342,7 @@ public class NotificationHelper {
|
|||||||
Status status = body.getStatus();
|
Status status = body.getStatus();
|
||||||
|
|
||||||
String citedLocalAuthor = status.getAccount().getLocalUsername();
|
String citedLocalAuthor = status.getAccount().getLocalUsername();
|
||||||
String citedText = status.getContent().toString();
|
String citedText = parseAsMastodonHtml(status.getContent()).toString();
|
||||||
String inReplyToId = status.getId();
|
String inReplyToId = status.getId();
|
||||||
Status actionableStatus = status.getActionableStatus();
|
Status actionableStatus = status.getActionableStatus();
|
||||||
Status.Visibility replyVisibility = actionableStatus.getVisibility();
|
Status.Visibility replyVisibility = actionableStatus.getVisibility();
|
||||||
@ -690,13 +691,13 @@ public class NotificationHelper {
|
|||||||
if (!TextUtils.isEmpty(notification.getStatus().getSpoilerText())) {
|
if (!TextUtils.isEmpty(notification.getStatus().getSpoilerText())) {
|
||||||
return notification.getStatus().getSpoilerText();
|
return notification.getStatus().getSpoilerText();
|
||||||
} else {
|
} else {
|
||||||
return notification.getStatus().getContent().toString();
|
return parseAsMastodonHtml(notification.getStatus().getContent()).toString();
|
||||||
}
|
}
|
||||||
case POLL:
|
case POLL:
|
||||||
if (!TextUtils.isEmpty(notification.getStatus().getSpoilerText())) {
|
if (!TextUtils.isEmpty(notification.getStatus().getSpoilerText())) {
|
||||||
return notification.getStatus().getSpoilerText();
|
return notification.getStatus().getSpoilerText();
|
||||||
} else {
|
} else {
|
||||||
StringBuilder builder = new StringBuilder(notification.getStatus().getContent());
|
StringBuilder builder = new StringBuilder(parseAsMastodonHtml(notification.getStatus().getContent()));
|
||||||
builder.append('\n');
|
builder.append('\n');
|
||||||
Poll poll = notification.getStatus().getPoll();
|
Poll poll = notification.getStatus().getPoll();
|
||||||
List<PollOption> options = poll.getOptions();
|
List<PollOption> options = poll.getOptions();
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with Tusky; if not,
|
* You should have received a copy of the GNU General Public License along with Tusky; if not,
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
|
@file:JvmName("StatusParsingHelper")
|
||||||
package com.keylesspalace.tusky.util
|
package com.keylesspalace.tusky.util
|
||||||
|
|
||||||
import android.text.SpannableStringBuilder
|
import android.text.SpannableStringBuilder
|
||||||
|
Loading…
Reference in New Issue
Block a user