2021-08-24 17:45:16 +00:00
|
|
|
package c.a.k.f;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
|
|
|
import android.text.SpannableStringBuilder;
|
|
|
|
import android.webkit.URLUtil;
|
2021-08-24 17:45:16 +00:00
|
|
|
import c.a.k.a;
|
2021-10-19 23:48:27 +00:00
|
|
|
import c0.z.d.m;
|
2021-06-27 20:44:35 +00:00
|
|
|
import com.discord.i18n.Hook;
|
|
|
|
import com.discord.i18n.RenderContext;
|
|
|
|
import com.discord.simpleast.core.node.Node;
|
|
|
|
import java.util.List;
|
|
|
|
/* compiled from: HookNode.kt */
|
|
|
|
public final class c extends Node.a<RenderContext> {
|
|
|
|
public final String a;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public c(String str) {
|
|
|
|
super(new Node[0]);
|
|
|
|
m.checkNotNullParameter(str, "key");
|
|
|
|
this.a = str;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.simpleast.core.node.Node.a, com.discord.simpleast.core.node.Node
|
|
|
|
public void render(SpannableStringBuilder spannableStringBuilder, Object obj) {
|
|
|
|
List<Object> list;
|
|
|
|
RenderContext renderContext = (RenderContext) obj;
|
|
|
|
m.checkNotNullParameter(spannableStringBuilder, "builder");
|
|
|
|
m.checkNotNullParameter(renderContext, "renderContext");
|
|
|
|
Hook hook = renderContext.b.get(this.a);
|
|
|
|
int length = spannableStringBuilder.length();
|
|
|
|
super.render(spannableStringBuilder, renderContext);
|
|
|
|
Hook.a aVar = null;
|
2021-10-05 20:14:30 +00:00
|
|
|
CharSequence charSequence = hook != null ? hook.b : null;
|
|
|
|
if (charSequence != null) {
|
|
|
|
spannableStringBuilder.replace(length, spannableStringBuilder.length(), charSequence);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!(hook == null || (list = hook.a) == null)) {
|
|
|
|
for (Object obj2 : list) {
|
|
|
|
spannableStringBuilder.setSpan(obj2, length, spannableStringBuilder.length(), 33);
|
|
|
|
}
|
|
|
|
}
|
2021-11-03 22:42:40 +00:00
|
|
|
Hook.a aVar2 = hook != null ? hook.f2506c : null;
|
2021-06-27 20:44:35 +00:00
|
|
|
if (aVar2 != null) {
|
|
|
|
aVar = aVar2;
|
|
|
|
} else if (URLUtil.isValidUrl(this.a)) {
|
|
|
|
a aVar3 = a.d;
|
2021-10-19 23:48:27 +00:00
|
|
|
aVar = new Hook.a(a.b.mo17invoke(), a.f204c);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (aVar != null) {
|
|
|
|
Integer num = aVar.a;
|
|
|
|
if (num == null) {
|
|
|
|
a aVar4 = a.d;
|
2021-10-19 23:48:27 +00:00
|
|
|
num = a.b.mo17invoke();
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
2021-08-24 17:45:16 +00:00
|
|
|
spannableStringBuilder.setSpan(new c.a.k.e.a(new b(this, aVar), num), length, spannableStringBuilder.length(), 33);
|
2021-06-27 20:44:35 +00:00
|
|
|
renderContext.g = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|