DiscussionNotificationMessage.smali

.class public Lio/rong/message/DiscussionNotificationMessage;
.super Lio/rong/message/NotificationMessage;
.source "DiscussionNotificationMessage.java"


# annotations
.annotation runtime Lio/rong/imlib/MessageTag;
    flag = 0x1
    value = "RC:DizNtf"
.end annotation


# static fields
.field public static final CREATOR:Landroid/os/Parcelable$Creator;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Landroid/os/Parcelable$Creator<",
            "Lio/rong/message/DiscussionNotificationMessage;",
            ">;"
        }
    .end annotation
.end field

.field private static final TAG:Ljava/lang/String; = "DiscussionNotificationMessage"


# instance fields
.field private extension:Ljava/lang/String;

.field private hasReceived:Z

.field private operator:Ljava/lang/String;

.field private type:I


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

    .line 1
    new-instance v0, Lio/rong/message/DiscussionNotificationMessage$1;

    invoke-direct {v0}, Lio/rong/message/DiscussionNotificationMessage$1;-><init>()V

    sput-object v0, Lio/rong/message/DiscussionNotificationMessage;->CREATOR:Landroid/os/Parcelable$Creator;

    return-void
.end method

.method public constructor <init>()V
    .registers 1

    .line 1
    invoke-direct {p0}, Lio/rong/message/NotificationMessage;-><init>()V

    return-void
.end method

.method public constructor <init>(Landroid/os/Parcel;)V
    .registers 3

    .line 2
    invoke-direct {p0}, Lio/rong/message/NotificationMessage;-><init>()V

    .line 3
    invoke-static {p1}, Lio/rong/common/ParcelUtils;->readIntFromParcel(Landroid/os/Parcel;)Ljava/lang/Integer;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v0

    iput v0, p0, Lio/rong/message/DiscussionNotificationMessage;->type:I

    .line 4
    invoke-static {p1}, Lio/rong/common/ParcelUtils;->readFromParcel(Landroid/os/Parcel;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lio/rong/message/DiscussionNotificationMessage;->extension:Ljava/lang/String;

    .line 5
    invoke-static {p1}, Lio/rong/common/ParcelUtils;->readFromParcel(Landroid/os/Parcel;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lio/rong/message/DiscussionNotificationMessage;->operator:Ljava/lang/String;

    .line 6
    const-class v0, Lio/rong/imlib/model/UserInfo;

    invoke-static {p1, v0}, Lio/rong/common/ParcelUtils;->readFromParcel(Landroid/os/Parcel;Ljava/lang/Class;)Landroid/os/Parcelable;

    move-result-object p1

    check-cast p1, Lio/rong/imlib/model/UserInfo;

    invoke-virtual {p0, p1}, Lio/rong/imlib/model/MessageContent;->setUserInfo(Lio/rong/imlib/model/UserInfo;)V

    return-void
.end method

.method public constructor <init>([B)V
    .registers 5

    const-string v0, "user"

    .line 7
    invoke-direct {p0}, Lio/rong/message/NotificationMessage;-><init>()V

    .line 8
    :try_start_5
    new-instance v1, Ljava/lang/String;

    const-string v2, "UTF-8"

    invoke-direct {v1, p1, v2}, Ljava/lang/String;-><init>([BLjava/lang/String;)V
    :try_end_c
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_5 .. :try_end_c} :catch_d

    goto :goto_16

    :catch_d
    move-exception p1

    const-string v1, "DiscussionNotificationMessage"

    const-string v2, "UnsupportedEncodingException"

    .line 9
    invoke-static {v1, v2, p1}, Lio/rong/common/RLog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    const/4 v1, 0x0

    .line 10
    :goto_16
    :try_start_16
    new-instance p1, Lorg/json/JSONObject;

    invoke-direct {p1, v1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    const-string v1, "type"

    .line 11
    invoke-virtual {p1, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {p0, v1}, Lio/rong/message/DiscussionNotificationMessage;->setType(I)V

    const-string v1, "extension"

    .line 12
    invoke-virtual {p1, v1}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p0, v1}, Lio/rong/message/DiscussionNotificationMessage;->setExtension(Ljava/lang/String;)V

    const-string v1, "operator"

    .line 13
    invoke-virtual {p1, v1}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p0, v1}, Lio/rong/message/DiscussionNotificationMessage;->setOperator(Ljava/lang/String;)V

    .line 14
    invoke-virtual {p1, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_52

    .line 15
    invoke-virtual {p1, v0}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object p1

    invoke-virtual {p0, p1}, Lio/rong/imlib/model/MessageContent;->parseJsonToUserInfo(Lorg/json/JSONObject;)Lio/rong/imlib/model/UserInfo;

    move-result-object p1

    invoke-virtual {p0, p1}, Lio/rong/imlib/model/MessageContent;->setUserInfo(Lio/rong/imlib/model/UserInfo;)V
    :try_end_47
    .catch Lorg/json/JSONException; {:try_start_16 .. :try_end_47} :catch_48

    goto :goto_52

    :catch_48
    move-exception p1

    .line 16
    invoke-virtual {p1}, Lorg/json/JSONException;->getMessage()Ljava/lang/String;

    move-result-object p1

    const-string v0, "JSONException"

    invoke-static {v0, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    :cond_52
    :goto_52
    return-void
.end method


# virtual methods
.method public describeContents()I
    .registers 2

    const/4 v0, 0x0

    return v0
.end method

.method public encode()[B
    .registers 4

    .line 1
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    :try_start_5
    const-string v1, "type"

    .line 2
    iget v2, p0, Lio/rong/message/DiscussionNotificationMessage;->type:I

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    const-string v1, "extension"

    .line 3
    iget-object v2, p0, Lio/rong/message/DiscussionNotificationMessage;->extension:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    .line 4
    invoke-virtual {p0}, Lio/rong/imlib/model/MessageContent;->getJSONUserInfo()Lorg/json/JSONObject;

    move-result-object v1

    if-eqz v1, :cond_2d

    const-string v1, "user"

    .line 5
    invoke-virtual {p0}, Lio/rong/imlib/model/MessageContent;->getJSONUserInfo()Lorg/json/JSONObject;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->putOpt(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    :try_end_22
    .catch Lorg/json/JSONException; {:try_start_5 .. :try_end_22} :catch_23

    goto :goto_2d

    :catch_23
    move-exception v1

    .line 6
    invoke-virtual {v1}, Lorg/json/JSONException;->getMessage()Ljava/lang/String;

    move-result-object v1

    const-string v2, "JSONException"

    invoke-static {v2, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 7
    :cond_2d
    :goto_2d
    :try_start_2d
    invoke-virtual {v0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v0

    const-string v1, "UTF-8"

    invoke-virtual {v0, v1}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object v0
    :try_end_37
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_2d .. :try_end_37} :catch_38

    return-object v0

    :catch_38
    move-exception v0

    const-string v1, "DiscussionNotificationMessage"

    const-string v2, "UnsupportedEncodingException"

    .line 8
    invoke-static {v1, v2, v0}, Lio/rong/common/RLog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    const/4 v0, 0x0

    return-object v0
.end method

.method public getExtension()Ljava/lang/String;
    .registers 2

    .line 1
    iget-object v0, p0, Lio/rong/message/DiscussionNotificationMessage;->extension:Ljava/lang/String;

    return-object v0
.end method

.method public getOperator()Ljava/lang/String;
    .registers 2

    .line 1
    iget-object v0, p0, Lio/rong/message/DiscussionNotificationMessage;->operator:Ljava/lang/String;

    return-object v0
.end method

.method public getType()I
    .registers 2

    .line 1
    iget v0, p0, Lio/rong/message/DiscussionNotificationMessage;->type:I

    return v0
.end method

.method public isHasReceived()Z
    .registers 2

    .line 1
    iget-boolean v0, p0, Lio/rong/message/DiscussionNotificationMessage;->hasReceived:Z

    return v0
.end method

.method public setExtension(Ljava/lang/String;)V
    .registers 2

    .line 1
    iput-object p1, p0, Lio/rong/message/DiscussionNotificationMessage;->extension:Ljava/lang/String;

    return-void
.end method

.method public setHasReceived(Z)V
    .registers 2

    .line 1
    iput-boolean p1, p0, Lio/rong/message/DiscussionNotificationMessage;->hasReceived:Z

    return-void
.end method

.method public setOperator(Ljava/lang/String;)V
    .registers 2

    .line 1
    iput-object p1, p0, Lio/rong/message/DiscussionNotificationMessage;->operator:Ljava/lang/String;

    return-void
.end method

.method public setType(I)V
    .registers 2

    .line 1
    iput p1, p0, Lio/rong/message/DiscussionNotificationMessage;->type:I

    return-void
.end method

.method public writeToParcel(Landroid/os/Parcel;I)V
    .registers 3

    .line 1
    iget p2, p0, Lio/rong/message/DiscussionNotificationMessage;->type:I

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

    move-result-object p2

    invoke-static {p1, p2}, Lio/rong/common/ParcelUtils;->writeToParcel(Landroid/os/Parcel;Ljava/lang/Integer;)V

    .line 2
    iget-object p2, p0, Lio/rong/message/DiscussionNotificationMessage;->extension:Ljava/lang/String;

    invoke-static {p1, p2}, Lio/rong/common/ParcelUtils;->writeToParcel(Landroid/os/Parcel;Ljava/lang/String;)V

    .line 3
    iget-object p2, p0, Lio/rong/message/DiscussionNotificationMessage;->operator:Ljava/lang/String;

    invoke-static {p1, p2}, Lio/rong/common/ParcelUtils;->writeToParcel(Landroid/os/Parcel;Ljava/lang/String;)V

    .line 4
    invoke-virtual {p0}, Lio/rong/imlib/model/MessageContent;->getUserInfo()Lio/rong/imlib/model/UserInfo;

    move-result-object p2

    invoke-static {p1, p2}, Lio/rong/common/ParcelUtils;->writeToParcel(Landroid/os/Parcel;Landroid/os/Parcelable;)V

    return-void
.end method