ConversationFragment$41.smali

.class Lio/rong/imkit/fragment/ConversationFragment$41;
.super Ljava/lang/Object;
.source "ConversationFragment.java"

# interfaces
.implements Lio/rong/imkit/fragment/IHistoryDataResultCallback;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lio/rong/imkit/fragment/ConversationFragment;->getRemoteHistoryMessages(Lio/rong/imlib/model/Conversation$ConversationType;Ljava/lang/String;I)V
.end annotation

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

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Lio/rong/imkit/fragment/IHistoryDataResultCallback<",
        "Ljava/util/List<",
        "Lio/rong/imlib/model/Message;",
        ">;>;"
    }
.end annotation


# instance fields
.field final synthetic this$0:Lio/rong/imkit/fragment/ConversationFragment;

.field final synthetic val$getHistoryCount:I


# direct methods
.method constructor <init>(Lio/rong/imkit/fragment/ConversationFragment;I)V
    .registers 3

    .line 1
    iput-object p1, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->this$0:Lio/rong/imkit/fragment/ConversationFragment;

    iput p2, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->val$getHistoryCount:I

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

    return-void
.end method


# virtual methods
.method public onError()V
    .registers 4

    .line 1
    iget-object v0, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->this$0:Lio/rong/imkit/fragment/ConversationFragment;

    # getter for: Lio/rong/imkit/fragment/ConversationFragment;->mList:Lio/rong/imkit/widget/AutoRefreshListView;
    invoke-static {v0}, Lio/rong/imkit/fragment/ConversationFragment;->access$300(Lio/rong/imkit/fragment/ConversationFragment;)Lio/rong/imkit/widget/AutoRefreshListView;

    move-result-object v0

    iget v1, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->val$getHistoryCount:I

    const/4 v2, 0x0

    invoke-virtual {v0, v2, v1, v2}, Lio/rong/imkit/widget/AutoRefreshListView;->onRefreshComplete(IIZ)V

    return-void
.end method

.method public bridge synthetic onResult(Ljava/lang/Object;)V
    .registers 2

    .line 1
    check-cast p1, Ljava/util/List;

    invoke-virtual {p0, p1}, Lio/rong/imkit/fragment/ConversationFragment$41;->onResult(Ljava/util/List;)V

    return-void
.end method

.method public onResult(Ljava/util/List;)V
    .registers 11
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Lio/rong/imlib/model/Message;",
            ">;)V"
        }
    .end annotation

    .line 2
    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string v1, "getRemoteHistoryMessages "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const/4 v1, 0x0

    if-nez p1, :cond_f

    const/4 v2, 0x0

    goto :goto_13

    :cond_f
    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v2

    :goto_13
    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const-string v2, "ConversationFragment"

    invoke-static {v2, v0}, Lio/rong/common/RLog;->i(Ljava/lang/String;Ljava/lang/String;)I

    const/4 v0, 0x0

    if-eqz p1, :cond_10c

    .line 3
    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v2

    if-lez v2, :cond_10c

    .line 4
    iget-object v2, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->this$0:Lio/rong/imkit/fragment/ConversationFragment;

    # getter for: Lio/rong/imkit/fragment/ConversationFragment;->mListAdapter:Lio/rong/imkit/widget/adapter/MessageListAdapter;
    invoke-static {v2}, Lio/rong/imkit/fragment/ConversationFragment;->access$200(Lio/rong/imkit/fragment/ConversationFragment;)Lio/rong/imkit/widget/adapter/MessageListAdapter;

    move-result-object v2

    invoke-virtual {v2}, Lio/rong/imkit/widget/adapter/BaseAdapter;->getCount()I

    move-result v2

    if-nez v2, :cond_3a

    .line 5
    invoke-interface {p1, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lio/rong/imlib/model/Message;

    .line 6
    :cond_3a
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    .line 7
    invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :cond_43
    :goto_43
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_99

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lio/rong/imlib/model/Message;

    .line 8
    invoke-static {}, Lio/rong/imkit/voiceMessageDownload/HQVoiceMsgDownloadManager;->getInstance()Lio/rong/imkit/voiceMessageDownload/HQVoiceMsgDownloadManager;

    move-result-object v5

    iget-object v6, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->this$0:Lio/rong/imkit/fragment/ConversationFragment;

    new-instance v7, Lio/rong/imkit/voiceMessageDownload/AutoDownloadEntry;

    sget-object v8, Lio/rong/imkit/voiceMessageDownload/AutoDownloadEntry$DownloadPriority;->HIGH:Lio/rong/imkit/voiceMessageDownload/AutoDownloadEntry$DownloadPriority;

    invoke-direct {v7, v4, v8}, Lio/rong/imkit/voiceMessageDownload/AutoDownloadEntry;-><init>(Lio/rong/imlib/model/Message;Lio/rong/imkit/voiceMessageDownload/AutoDownloadEntry$DownloadPriority;)V

    invoke-virtual {v5, v6, v7}, Lio/rong/imkit/voiceMessageDownload/HQVoiceMsgDownloadManager;->enqueue(Landroidx/fragment/app/Fragment;Lio/rong/imkit/voiceMessageDownload/AutoDownloadEntry;)V

    .line 9
    invoke-virtual {v4}, Lio/rong/imlib/model/Message;->getMessageId()I

    move-result v5

    if-lez v5, :cond_43

    .line 10
    invoke-static {v4}, Lio/rong/imkit/model/UIMessage;->obtain(Lio/rong/imlib/model/Message;)Lio/rong/imkit/model/UIMessage;

    move-result-object v5

    .line 11
    invoke-virtual {v4}, Lio/rong/imlib/model/Message;->getContent()Lio/rong/imlib/model/MessageContent;

    move-result-object v6

    instance-of v6, v6, Lio/rong/message/CSPullLeaveMessage;

    if-eqz v6, :cond_7a

    .line 12
    iget-object v6, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->this$0:Lio/rong/imkit/fragment/ConversationFragment;

    # getter for: Lio/rong/imkit/fragment/ConversationFragment;->mCustomServiceConfig:Lio/rong/imlib/CustomServiceConfig;
    invoke-static {v6}, Lio/rong/imkit/fragment/ConversationFragment;->access$4300(Lio/rong/imkit/fragment/ConversationFragment;)Lio/rong/imlib/CustomServiceConfig;

    move-result-object v6

    invoke-virtual {v5, v6}, Lio/rong/imkit/model/UIMessage;->setCsConfig(Lio/rong/imlib/CustomServiceConfig;)V

    .line 13
    :cond_7a
    invoke-virtual {v4}, Lio/rong/imlib/model/Message;->getContent()Lio/rong/imlib/model/MessageContent;

    move-result-object v6

    if-eqz v6, :cond_95

    invoke-virtual {v4}, Lio/rong/imlib/model/Message;->getContent()Lio/rong/imlib/model/MessageContent;

    move-result-object v6

    invoke-virtual {v6}, Lio/rong/imlib/model/MessageContent;->getUserInfo()Lio/rong/imlib/model/UserInfo;

    move-result-object v6

    if-eqz v6, :cond_95

    .line 14
    invoke-virtual {v4}, Lio/rong/imlib/model/Message;->getContent()Lio/rong/imlib/model/MessageContent;

    move-result-object v4

    invoke-virtual {v4}, Lio/rong/imlib/model/MessageContent;->getUserInfo()Lio/rong/imlib/model/UserInfo;

    move-result-object v4

    invoke-virtual {v5, v4}, Lio/rong/imkit/model/UIMessage;->setUserInfo(Lio/rong/imlib/model/UserInfo;)V

    .line 15
    :cond_95
    invoke-interface {v2, v5}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_43

    .line 16
    :cond_99
    iget-object v3, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->this$0:Lio/rong/imkit/fragment/ConversationFragment;

    # invokes: Lio/rong/imkit/fragment/ConversationFragment;->filterMessage(Ljava/util/List;)Ljava/util/List;
    invoke-static {v3, v2}, Lio/rong/imkit/fragment/ConversationFragment;->access$5500(Lio/rong/imkit/fragment/ConversationFragment;Ljava/util/List;)Ljava/util/List;

    move-result-object v2

    if-eqz v2, :cond_100

    .line 17
    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v3

    if-lez v3, :cond_100

    .line 18
    invoke-interface {v2}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_ab
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_c6

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lio/rong/imkit/model/UIMessage;

    .line 19
    sget-object v4, Lio/rong/imlib/model/Message$SentStatus;->READ:Lio/rong/imlib/model/Message$SentStatus;

    invoke-virtual {v3, v4}, Lio/rong/imkit/model/UIMessage;->setSentStatus(Lio/rong/imlib/model/Message$SentStatus;)V

    .line 20
    iget-object v4, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->this$0:Lio/rong/imkit/fragment/ConversationFragment;

    # getter for: Lio/rong/imkit/fragment/ConversationFragment;->mListAdapter:Lio/rong/imkit/widget/adapter/MessageListAdapter;
    invoke-static {v4}, Lio/rong/imkit/fragment/ConversationFragment;->access$200(Lio/rong/imkit/fragment/ConversationFragment;)Lio/rong/imkit/widget/adapter/MessageListAdapter;

    move-result-object v4

    invoke-virtual {v4, v3, v1}, Lio/rong/imkit/widget/adapter/BaseAdapter;->add(Ljava/lang/Object;I)V

    goto :goto_ab

    .line 21
    :cond_c6
    iget-object v2, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->this$0:Lio/rong/imkit/fragment/ConversationFragment;

    # getter for: Lio/rong/imkit/fragment/ConversationFragment;->mListAdapter:Lio/rong/imkit/widget/adapter/MessageListAdapter;
    invoke-static {v2}, Lio/rong/imkit/fragment/ConversationFragment;->access$200(Lio/rong/imkit/fragment/ConversationFragment;)Lio/rong/imkit/widget/adapter/MessageListAdapter;

    move-result-object v2

    invoke-virtual {v2}, Landroid/widget/BaseAdapter;->notifyDataSetChanged()V

    .line 22
    iget-object v2, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->this$0:Lio/rong/imkit/fragment/ConversationFragment;

    # getter for: Lio/rong/imkit/fragment/ConversationFragment;->mList:Lio/rong/imkit/widget/AutoRefreshListView;
    invoke-static {v2}, Lio/rong/imkit/fragment/ConversationFragment;->access$300(Lio/rong/imkit/fragment/ConversationFragment;)Lio/rong/imkit/widget/AutoRefreshListView;

    move-result-object v2

    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v3

    add-int/lit8 v3, v3, 0x1

    invoke-virtual {v2, v3}, Landroid/widget/ListView;->setSelection(I)V

    .line 23
    iget-object v2, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->this$0:Lio/rong/imkit/fragment/ConversationFragment;

    # invokes: Lio/rong/imkit/fragment/ConversationFragment;->sendReadReceiptResponseIfNeeded(Ljava/util/List;)V
    invoke-static {v2, p1}, Lio/rong/imkit/fragment/ConversationFragment;->access$5600(Lio/rong/imkit/fragment/ConversationFragment;Ljava/util/List;)V

    .line 24
    iget-object v2, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->this$0:Lio/rong/imkit/fragment/ConversationFragment;

    # getter for: Lio/rong/imkit/fragment/ConversationFragment;->mList:Lio/rong/imkit/widget/AutoRefreshListView;
    invoke-static {v2}, Lio/rong/imkit/fragment/ConversationFragment;->access$300(Lio/rong/imkit/fragment/ConversationFragment;)Lio/rong/imkit/widget/AutoRefreshListView;

    move-result-object v2

    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result p1

    iget v3, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->val$getHistoryCount:I

    invoke-virtual {v2, p1, v3, v1}, Lio/rong/imkit/widget/AutoRefreshListView;->onRefreshComplete(IIZ)V

    if-eqz v0, :cond_117

    .line 25
    invoke-static {}, Lio/rong/imkit/RongContext;->getInstance()Lio/rong/imkit/RongContext;

    move-result-object p1

    invoke-virtual {p1}, Lio/rong/imkit/RongContext;->getEventBus()Lio/rong/eventbus/EventBus;

    move-result-object p1

    invoke-virtual {p1, v0}, Lio/rong/eventbus/EventBus;->post(Ljava/lang/Object;)V

    goto :goto_117

    .line 26
    :cond_100
    iget-object p1, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->this$0:Lio/rong/imkit/fragment/ConversationFragment;

    # getter for: Lio/rong/imkit/fragment/ConversationFragment;->mList:Lio/rong/imkit/widget/AutoRefreshListView;
    invoke-static {p1}, Lio/rong/imkit/fragment/ConversationFragment;->access$300(Lio/rong/imkit/fragment/ConversationFragment;)Lio/rong/imkit/widget/AutoRefreshListView;

    move-result-object p1

    iget v0, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->val$getHistoryCount:I

    invoke-virtual {p1, v1, v0, v1}, Lio/rong/imkit/widget/AutoRefreshListView;->onRefreshComplete(IIZ)V

    goto :goto_117

    .line 27
    :cond_10c
    iget-object p1, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->this$0:Lio/rong/imkit/fragment/ConversationFragment;

    # getter for: Lio/rong/imkit/fragment/ConversationFragment;->mList:Lio/rong/imkit/widget/AutoRefreshListView;
    invoke-static {p1}, Lio/rong/imkit/fragment/ConversationFragment;->access$300(Lio/rong/imkit/fragment/ConversationFragment;)Lio/rong/imkit/widget/AutoRefreshListView;

    move-result-object p1

    iget v0, p0, Lio/rong/imkit/fragment/ConversationFragment$41;->val$getHistoryCount:I

    invoke-virtual {p1, v1, v0, v1}, Lio/rong/imkit/widget/AutoRefreshListView;->onRefreshComplete(IIZ)V

    :cond_117
    :goto_117
    return-void
.end method