.class Ldev/maelstrom/ykit/PostJsonAdapterShim$BlogChangedListener;
.super Landroid/content/BroadcastReceiver;
.source "SourceFile"


# direct methods
.method constructor <init>(Lcom/tumblr/ui/fragment/UserBlogPagesDashboardFragment;)V
    .registers 2

    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    return-void
.end method


# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 4

    # If intent is null, skip
    if-eqz p2, :return

    # If not blog changed event, skip
    invoke-static {p2}, Lee0/p;->g(Landroid/content/Intent;)Z # BlogChangedEvent.isBlogChangedEvent
    move-result v0
    if-eqz v0, :return

    # Get blog info
    invoke-static {p2}, Lee0/p;->f(Landroid/content/Intent;)Lcom/tumblr/bloginfo/BlogInfo; # BlogChangedEvent.getBlogInfo
    move-result-object v1

    # Get blog url
    invoke-virtual {v1}, Lcom/tumblr/bloginfo/BlogInfo;->T()Ljava/lang/String; # getName
    move-result-object v1

    # Append tumblr extension for host name
    const-string v2, ".tumblr.com"
    invoke-virtual {v1, v2}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
    move-result-object v1

    ## Because you cannot make requests on the ui thread, start a new thread in the background and fetch the blocklist from it (async)

    # Start new thread
    new-instance v2, Ldev/maelstrom/ykit/PostJsonAdapterShim$BlogChangedListener$Thread;
    invoke-direct {v2, v1}, Ldev/maelstrom/ykit/PostJsonAdapterShim$BlogChangedListener$Thread;-><init>(Ljava/lang/String;)V

    new-instance v3, Ljava/lang/Thread;
    invoke-direct {v3, v2}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V
    invoke-virtual {v3}, Ljava/lang/Thread;->start()V

    :return
    return-void
.end method
