package com.tencent.mm.plugin.topstory;

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ai.e.a;
import com.tencent.mm.g.a.px;
import com.tencent.mm.plugin.messenger.foundation.a.o;
import com.tencent.mm.plugin.websearch.api.an;
import com.tencent.mm.protocal.protobuf.cht;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.ytcommon.BuildConfig;
import java.util.Map;

class b$1 implements o {
    final /* synthetic */ b sAu;

    b$1(b bVar) {
        this.sAu = bVar;
    }

    public final void onNewXmlReceived(String str, Map<String, String> map, a aVar) {
        AppMethodBeat.i(65453);
        if (!(map == null || str == null || !str.equals("mmsearch_reddot_new"))) {
            int ank = bo.ank((String) map.get(".sysmsg.mmsearch_reddot_new.entry"));
            if (ank == 2) {
                cht cht = new cht();
                b.c(cht);
                ab.i("MicroMsg.TopStory.TopStoryRedDotImpl", "recv %s, %s", new Object[]{"mmsearch_reddot_new", map.toString()});
                cht.xgA = bo.ank((String) map.get(".sysmsg.mmsearch_reddot_new.clear"));
                cht.uaU = ank;
                cht.cJb = bo.t((String) map.get(".sysmsg.mmsearch_reddot_new.msgid"), new Object[0]);
                cht.uaW = bo.ank((String) map.get(".sysmsg.mmsearch_reddot_new.discovery"));
                cht.uaV = bo.ank((String) map.get(".sysmsg.mmsearch_reddot_new.android_cli_version"));
                cht.fRS = bo.anl((String) map.get(".sysmsg.mmsearch_reddot_new.expire_time"));
                cht.tZU = bo.ank((String) map.get(".sysmsg.mmsearch_reddot_new.h5_version"));
                cht.type = bo.ank((String) map.get(".sysmsg.mmsearch_reddot_new.reddot_type"));
                cht.text = (String) map.get(".sysmsg.mmsearch_reddot_new.reddot_text");
                cht.cIY = (String) map.get(".sysmsg.mmsearch_reddot_new.reddot_icon");
                cht.xgz = bo.anl((String) map.get(".sysmsg.mmsearch_reddot_new.timestamp"));
                cht.xgB = System.currentTimeMillis();
                cht.fQi = bo.ank((String) map.get(".sysmsg.mmsearch_reddot_new.seq"));
                cht.extInfo = bo.t((String) map.get(".sysmsg.mmsearch_reddot_new.ext_info"), new Object[0]);
                if (cht.xgA != 1) {
                    switch (cht.type) {
                        case 1:
                        case 2:
                        case 3:
                        case 4:
                            an.a(cht, 100, 1, 0, 0, BuildConfig.FLAVOR);
                            this.sAu.a(cht);
                            AppMethodBeat.o(65453);
                            return;
                        case 7:
                            an.a(cht, 100, 2, this.sAu.sAn.size(), 0, BuildConfig.FLAVOR);
                            this.sAu.b(cht);
                            AppMethodBeat.o(65453);
                            return;
                        case 8:
                            an.a(cht, 100, 3, 0, 0, BuildConfig.FLAVOR);
                            b.abx(cht.cJb);
                            AppMethodBeat.o(65453);
                            return;
                        case 9:
                            if (this.sAu.sAo != null) {
                                this.sAu.sAo.aby(cht.extInfo);
                                an.a(cht, 100, 4, 0, 0, BuildConfig.FLAVOR);
                                AppMethodBeat.o(65453);
                                return;
                            }
                            break;
                        case 10:
                            an.a(cht, 100, 5, 0, 0, BuildConfig.FLAVOR);
                            this.sAu.m(cht.cJb, cht.extInfo, cht.xgz);
                            AppMethodBeat.o(65453);
                            return;
                        default:
                            an.a(cht, 109, 0, 0, 0, "r12|" + cht.type);
                            break;
                    }
                }
                b bVar = this.sAu;
                switch (cht.type) {
                    case 1:
                    case 2:
                    case 3:
                    case 4:
                        bVar.A(cht.xgz, false);
                        com.tencent.mm.sdk.b.a.xxA.m(new px());
                        break;
                    case 7:
                        bVar.a(cht.xgz, true, cht.fQi, false);
                        com.tencent.mm.sdk.b.a.xxA.m(new px());
                        break;
                    case 8:
                        b.abx(BuildConfig.FLAVOR);
                        break;
                    case 10:
                        bVar.m(BuildConfig.FLAVOR, BuildConfig.FLAVOR, 0);
                        break;
                }
                switch (cht.type) {
                    case 7:
                        ank = 2;
                        break;
                    case 8:
                        ank = 3;
                        break;
                    case 9:
                        ank = 4;
                        break;
                    default:
                        ank = 1;
                        break;
                }
                an.a(cht, 100, ank, 0, 0, BuildConfig.FLAVOR);
                AppMethodBeat.o(65453);
                return;
            }
        }
        AppMethodBeat.o(65453);
    }
}
