ChatActivityEnterView$12.smali

.class Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;
.super Ljava/lang/Object;
.source "ChatActivityEnterView.java"

# interfaces
.implements Landroid/text/TextWatcher;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lim/tpelyyftgw/ui/components/ChatActivityEnterView;-><init>(Landroid/app/Activity;Lim/tpelyyftgw/ui/components/SizeNotifierFrameLayout;Lim/tpelyyftgw/ui/ChatActivity;Z)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field processChange:Z

.field final synthetic this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;


# direct methods
.method static constructor <clinit>()V
    .registers 1

    return-void
.end method

.method constructor <init>(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)V
    .registers 3
    .param p1, "this$0"    # Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    .line 1096
    iput-object p1, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 1097
    const/4 v0, 0x0

    iput-boolean v0, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->processChange:Z

    return-void
.end method


# virtual methods
.method public afterTextChanged(Landroid/text/Editable;)V
    .registers 6
    .param p1, "editable"    # Landroid/text/Editable;

    .line 1151
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v0}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$5500(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)I

    move-result v0

    if-eqz v0, :cond_9

    .line 1152
    return-void

    .line 1154
    :cond_9
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v0}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$5100(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)Z

    move-result v0

    if-eqz v0, :cond_32

    invoke-interface {p1}, Landroid/text/Editable;->length()I

    move-result v0

    if-lez v0, :cond_32

    invoke-interface {p1}, Landroid/text/Editable;->length()I

    move-result v0

    add-int/lit8 v0, v0, -0x1

    invoke-interface {p1, v0}, Landroid/text/Editable;->charAt(I)C

    move-result v0

    const/16 v1, 0xa

    if-ne v0, v1, :cond_32

    iget-object v0, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v0}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$5200(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)Lim/tpelyyftgw/messenger/MessageObject;

    move-result-object v0

    if-nez v0, :cond_32

    .line 1155
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v0}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$5400(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)V

    .line 1157
    :cond_32
    iget-boolean v0, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->processChange:Z

    if-eqz v0, :cond_68

    .line 1158
    invoke-interface {p1}, Landroid/text/Editable;->length()I

    move-result v0

    const-class v1, Landroid/text/style/ImageSpan;

    const/4 v2, 0x0

    invoke-interface {p1, v2, v0, v1}, Landroid/text/Editable;->getSpans(IILjava/lang/Class;)[Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [Landroid/text/style/ImageSpan;

    .line 1159
    .local v0, "spans":[Landroid/text/style/ImageSpan;
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_44
    array-length v3, v0

    if-ge v1, v3, :cond_4f

    .line 1160
    aget-object v3, v0, v1

    invoke-interface {p1, v3}, Landroid/text/Editable;->removeSpan(Ljava/lang/Object;)V

    .line 1159
    add-int/lit8 v1, v1, 0x1

    goto :goto_44

    .line 1162
    .end local v1    # "i":I
    :cond_4f
    iget-object v1, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v1}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$300(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)Lim/tpelyyftgw/ui/components/EditTextCaption;

    move-result-object v1

    invoke-virtual {v1}, Lim/tpelyyftgw/ui/components/EditTextCaption;->getPaint()Landroid/text/TextPaint;

    move-result-object v1

    invoke-virtual {v1}, Landroid/text/TextPaint;->getFontMetricsInt()Landroid/graphics/Paint$FontMetricsInt;

    move-result-object v1

    const/high16 v3, 0x41a00000    # 20.0f

    invoke-static {v3}, Lim/tpelyyftgw/messenger/AndroidUtilities;->dp(F)I

    move-result v3

    invoke-static {p1, v1, v3, v2}, Lim/tpelyyftgw/messenger/Emoji;->replaceEmoji(Ljava/lang/CharSequence;Landroid/graphics/Paint$FontMetricsInt;IZ)Ljava/lang/CharSequence;

    .line 1163
    iput-boolean v2, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->processChange:Z

    .line 1165
    .end local v0    # "spans":[Landroid/text/style/ImageSpan;
    :cond_68
    return-void
.end method

.method public beforeTextChanged(Ljava/lang/CharSequence;III)V
    .registers 5
    .param p1, "charSequence"    # Ljava/lang/CharSequence;
    .param p2, "i"    # I
    .param p3, "i2"    # I
    .param p4, "i3"    # I

    .line 1102
    return-void
.end method

.method public onTextChanged(Ljava/lang/CharSequence;III)V
    .registers 12
    .param p1, "charSequence"    # Ljava/lang/CharSequence;
    .param p2, "start"    # I
    .param p3, "before"    # I
    .param p4, "count"    # I

    .line 1106
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v0}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$5500(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)I

    move-result v0

    const/4 v1, 0x1

    if-ne v0, v1, :cond_a

    .line 1107
    return-void

    .line 1120
    :cond_a
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v0, v1}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$1400(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;Z)V

    .line 1121
    invoke-interface {p1}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lim/tpelyyftgw/messenger/AndroidUtilities;->getTrimmedString(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;

    move-result-object v0

    .line 1122
    .local v0, "message":Ljava/lang/CharSequence;
    iget-object v2, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v2}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$1500(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)Lim/tpelyyftgw/ui/components/ChatActivityEnterView$ChatActivityEnterViewDelegate;

    move-result-object v2

    const/4 v3, 0x2

    if-eqz v2, :cond_4c

    .line 1123
    iget-object v2, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v2}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$5600(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)Z

    move-result v2

    if-nez v2, :cond_4c

    .line 1124
    if-gt p4, v3, :cond_32

    if-eqz p1, :cond_32

    invoke-interface {p1}, Ljava/lang/CharSequence;->length()I

    move-result v2

    if-nez v2, :cond_37

    .line 1125
    :cond_32
    iget-object v2, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v2, v1}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$5702(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;Z)Z

    .line 1127
    :cond_37
    iget-object v2, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v2}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$1500(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)Lim/tpelyyftgw/ui/components/ChatActivityEnterView$ChatActivityEnterViewDelegate;

    move-result-object v2

    add-int/lit8 v4, p4, 0x1

    if-gt p3, v4, :cond_48

    sub-int v4, p4, p3

    if-le v4, v3, :cond_46

    goto :goto_48

    :cond_46
    const/4 v4, 0x0

    goto :goto_49

    :cond_48
    :goto_48
    const/4 v4, 0x1

    :goto_49
    invoke-interface {v2, p1, v4}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$ChatActivityEnterViewDelegate;->onTextChanged(Ljava/lang/CharSequence;Z)V

    .line 1130
    :cond_4c
    iget-object v2, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v2}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$5500(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)I

    move-result v2

    if-eq v2, v3, :cond_5a

    sub-int v2, p4, p3

    if-le v2, v1, :cond_5a

    .line 1131
    iput-boolean v1, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->processChange:Z

    .line 1133
    :cond_5a
    iget-object v1, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v1}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$5200(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)Lim/tpelyyftgw/messenger/MessageObject;

    move-result-object v1

    if-nez v1, :cond_10b

    iget-object v1, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v1}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$5800(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)Z

    move-result v1

    if-nez v1, :cond_10b

    invoke-interface {v0}, Ljava/lang/CharSequence;->length()I

    move-result v1

    if-eqz v1, :cond_10b

    iget-object v1, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v1}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$5900(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)J

    move-result-wide v1

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

    const-wide/16 v5, 0x1388

    sub-long/2addr v3, v5

    cmp-long v5, v1, v3

    if-gez v5, :cond_10b

    iget-object v1, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v1}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$5600(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)Z

    move-result v1

    if-nez v1, :cond_10b

    .line 1134
    iget-object v1, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v1}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$2600(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)I

    move-result v1

    invoke-static {v1}, Lim/tpelyyftgw/tgnet/ConnectionsManager;->getInstance(I)Lim/tpelyyftgw/tgnet/ConnectionsManager;

    move-result-object v1

    invoke-virtual {v1}, Lim/tpelyyftgw/tgnet/ConnectionsManager;->getCurrentTime()I

    move-result v1

    .line 1135
    .local v1, "currentTime":I
    const/4 v2, 0x0

    .line 1136
    .local v2, "currentUser":Lim/tpelyyftgw/tgnet/TLRPC$User;
    iget-object v3, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v3}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$2700(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)J

    move-result-wide v3

    long-to-int v4, v3

    if-lez v4, :cond_ba

    .line 1137
    iget-object v3, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v3}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$4600(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)Lim/tpelyyftgw/messenger/AccountInstance;

    move-result-object v3

    invoke-virtual {v3}, Lim/tpelyyftgw/messenger/AccountInstance;->getMessagesController()Lim/tpelyyftgw/messenger/MessagesController;

    move-result-object v3

    iget-object v4, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v4}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$2700(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)J

    move-result-wide v4

    long-to-int v5, v4

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v3, v4}, Lim/tpelyyftgw/messenger/MessagesController;->getUser(Ljava/lang/Integer;)Lim/tpelyyftgw/tgnet/TLRPC$User;

    move-result-object v2

    .line 1139
    :cond_ba
    if-eqz v2, :cond_f1

    iget v3, v2, Lim/tpelyyftgw/tgnet/TLRPC$User;->id:I

    iget-object v4, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v4}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$2600(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)I

    move-result v4

    invoke-static {v4}, Lim/tpelyyftgw/messenger/UserConfig;->getInstance(I)Lim/tpelyyftgw/messenger/UserConfig;

    move-result-object v4

    invoke-virtual {v4}, Lim/tpelyyftgw/messenger/UserConfig;->getClientUserId()I

    move-result v4

    if-eq v3, v4, :cond_f0

    iget-object v3, v2, Lim/tpelyyftgw/tgnet/TLRPC$User;->status:Lim/tpelyyftgw/tgnet/TLRPC$UserStatus;

    if-eqz v3, :cond_f1

    iget-object v3, v2, Lim/tpelyyftgw/tgnet/TLRPC$User;->status:Lim/tpelyyftgw/tgnet/TLRPC$UserStatus;

    iget v3, v3, Lim/tpelyyftgw/tgnet/TLRPC$UserStatus;->expires:I

    if-ge v3, v1, :cond_f1

    iget-object v3, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v3}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$4600(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)Lim/tpelyyftgw/messenger/AccountInstance;

    move-result-object v3

    invoke-virtual {v3}, Lim/tpelyyftgw/messenger/AccountInstance;->getMessagesController()Lim/tpelyyftgw/messenger/MessagesController;

    move-result-object v3

    iget-object v3, v3, Lim/tpelyyftgw/messenger/MessagesController;->onlinePrivacy:Ljava/util/concurrent/ConcurrentHashMap;

    iget v4, v2, Lim/tpelyyftgw/tgnet/TLRPC$User;->id:I

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/util/concurrent/ConcurrentHashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_f1

    .line 1140
    :cond_f0
    return-void

    .line 1142
    :cond_f1
    iget-object v3, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v4

    invoke-static {v3, v4, v5}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$5902(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;J)J

    .line 1143
    iget-object v3, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v3}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$1500(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)Lim/tpelyyftgw/ui/components/ChatActivityEnterView$ChatActivityEnterViewDelegate;

    move-result-object v3

    if-eqz v3, :cond_10b

    .line 1144
    iget-object v3, p0, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$12;->this$0:Lim/tpelyyftgw/ui/components/ChatActivityEnterView;

    invoke-static {v3}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView;->access$1500(Lim/tpelyyftgw/ui/components/ChatActivityEnterView;)Lim/tpelyyftgw/ui/components/ChatActivityEnterView$ChatActivityEnterViewDelegate;

    move-result-object v3

    invoke-interface {v3}, Lim/tpelyyftgw/ui/components/ChatActivityEnterView$ChatActivityEnterViewDelegate;->needSendTyping()V

    .line 1147
    .end local v1    # "currentTime":I
    .end local v2    # "currentUser":Lim/tpelyyftgw/tgnet/TLRPC$User;
    :cond_10b
    return-void
.end method