package y20; import a.f; import a30.h; import android.graphics.Bitmap; import android.text.TextUtils; import com.meituan.robust.ChangeQuickRedirect; import com.meituan.robust.PatchProxy; import com.meituan.robust.PatchProxyResult; import com.shizhuang.duapp.R; import com.shizhuang.duapp.common.bean.UsersModel; import com.shizhuang.duapp.common.utils.StringUtils; import com.shizhuang.duapp.modules.du_community_common.model.CommunityFeedModel; import com.shizhuang.duapp.modules.du_community_common.model.MediaItemModel; import com.shizhuang.duapp.modules.du_community_common.model.user.MyTotalModel; import com.shizhuang.duapp.modules.router.ServiceManager; import com.shizhuang.model.trend.PersonalLetterModel; import com.shizhuang.model.trend.PersonalLetterPersonalModel; import com.shizhuang.model.trend.PersonalLetterTrendModel; import com.shizhuang.model.trend.PersonalLetterUserModel; import ei.a; import eo.b; import java.util.Iterator; import kotlin.Pair; import pb1.i; /* compiled from: TrendShareHelper */ public class b0 { public static ChangeQuickRedirect changeQuickRedirect; public static PersonalLetterModel a(UsersModel usersModel, MyTotalModel myTotalModel) { PatchProxyResult proxy = PatchProxy.proxy(new Object[]{usersModel, myTotalModel}, null, changeQuickRedirect, true, 101216, new Class[]{UsersModel.class, MyTotalModel.class}, PersonalLetterModel.class); if (proxy.isSupported) { return (PersonalLetterModel) proxy.result; } PersonalLetterModel personalLetterModel = new PersonalLetterModel(); personalLetterModel.type = 5; PersonalLetterPersonalModel personalLetterPersonalModel = new PersonalLetterPersonalModel(); personalLetterPersonalModel.userId = usersModel.userId; personalLetterPersonalModel.username = usersModel.userName; personalLetterPersonalModel.icon = usersModel.icon; personalLetterPersonalModel.beLikedNum = String.valueOf(myTotalModel.lightNum); personalLetterPersonalModel.fansNum = String.valueOf(myTotalModel.fansNum); StringBuilder h12 = f.h("https://m.poizon.com/router/trend/UserHomePage?userId="); h12.append(usersModel.userId); personalLetterPersonalModel.jumpUrl = h12.toString(); personalLetterPersonalModel.signature = usersModel.idiograph; personalLetterModel.userHomepage = personalLetterPersonalModel; return personalLetterModel; } public static PersonalLetterModel b(CommunityFeedModel communityFeedModel) { String str; String str2; PatchProxyResult proxy = PatchProxy.proxy(new Object[]{communityFeedModel}, null, changeQuickRedirect, true, 101215, new Class[]{CommunityFeedModel.class}, PersonalLetterModel.class); if (proxy.isSupported) { return (PersonalLetterModel) proxy.result; } PersonalLetterModel personalLetterModel = new PersonalLetterModel(); personalLetterModel.type = 4; PersonalLetterTrendModel personalLetterTrendModel = new PersonalLetterTrendModel(); personalLetterModel.trend = personalLetterTrendModel; if (a.a(communityFeedModel.getContent().getContentId())) { personalLetterTrendModel.contentId = "0"; } else { personalLetterTrendModel.contentId = communityFeedModel.getContent().getContentId(); } personalLetterTrendModel.contentType = String.valueOf(communityFeedModel.getContent().getContentType()); PersonalLetterUserModel personalLetterUserModel = new PersonalLetterUserModel(); personalLetterUserModel.userId = communityFeedModel.getUserId(); personalLetterUserModel.username = communityFeedModel.getUsername(); personalLetterUserModel.icon = communityFeedModel.getSafeUserInfo().icon; personalLetterTrendModel.userInfo = personalLetterUserModel; String str3 = ""; if (communityFeedModel.getContent().isVote()) { str2 = communityFeedModel.getContent().getTitleAndContent(); if (TextUtils.isEmpty(str2)) { str2 = communityFeedModel.getUsername() + " 发布了一条超酷的动态"; } if (!a.c(communityFeedModel.getContent().getMediaListModel())) { str3 = ((MediaItemModel) h.a.j(communityFeedModel, 0)).getOriginUrl(); } StringBuilder h12 = f.h("https://m.poizon.com/router/trend/FeedDetailsPage?id="); h12.append(personalLetterTrendModel.contentId); str = h12.toString(); } else if (communityFeedModel.getContent().isSpecialColumn()) { if (a.a(communityFeedModel.getContent().getTitle())) { str2 = communityFeedModel.getUsername() + " 发布了一条超酷的动态"; } else { str2 = communityFeedModel.getContent().getTitle(); } if (!a.b(communityFeedModel.getContent().getCover())) { str3 = communityFeedModel.getContent().getCover().getOriginUrl(); } StringBuilder h13 = f.h("https://m.poizon.com/router/trend/postsPage?id="); h13.append(personalLetterTrendModel.contentId); str = h13.toString(); } else if (communityFeedModel.getContent().isVideo()) { if (TextUtils.isEmpty(communityFeedModel.getContent().getTitleAndContent())) { str2 = communityFeedModel.getUsername() + " 发布了一条超酷的动态"; } else { str2 = communityFeedModel.getContent().getTitleAndContent(); } Iterator<MediaItemModel> it2 = communityFeedModel.getContent().getMediaListModel().iterator(); String str4 = str3; while (it2.hasNext()) { MediaItemModel next = it2.next(); if ("img".equals(next.getMediaType())) { str3 = next.getSafeOriginUrl(); } else if ("video".equals(next.getMediaType())) { str4 = next.getSafeOriginUrl(); } } if (a.a(str3)) { str3 = b.d(str4); } StringBuilder h14 = f.h("https://m.poizon.com/router/trend/videoPage?id="); h14.append(personalLetterTrendModel.contentId); str = h14.toString(); } else { str2 = communityFeedModel.getContent().getTitleAndContent(); if (TextUtils.isEmpty(str2)) { str2 = communityFeedModel.getUsername() + " 发布了一条超酷的动态"; } if (!a.c(communityFeedModel.getContent().getMediaListModel())) { str3 = ((MediaItemModel) h.a.j(communityFeedModel, 0)).getOriginUrl(); } StringBuilder h15 = f.h("https://m.poizon.com/router/trend/FeedDetailsPage?id="); h15.append(personalLetterTrendModel.contentId); str = h15.toString(); } personalLetterTrendModel.title = str2; personalLetterTrendModel.cover = str3; personalLetterTrendModel.jumpUrl = str; return personalLetterModel; } public static i c(CommunityFeedModel communityFeedModel, String str) { PatchProxyResult proxy = PatchProxy.proxy(new Object[]{communityFeedModel, str}, null, changeQuickRedirect, true, 101210, new Class[]{CommunityFeedModel.class, String.class}, i.class); if (proxy.isSupported) { return (i) proxy.result; } i iVar = new i(); try { if (communityFeedModel.getContent().isVote()) { g(iVar, communityFeedModel, str); } else if (communityFeedModel.getContent().isSpecialColumn()) { f(iVar, communityFeedModel, str); } else if (communityFeedModel.getContent().isVideo()) { i(iVar, communityFeedModel, str); } else { h(iVar, communityFeedModel, str); } } catch (Exception e) { fo.a.j(e, "TrendShareHelper", new Object[0]); e.printStackTrace(); } return iVar; } public static i d(Bitmap bitmap) { PatchProxyResult proxy = PatchProxy.proxy(new Object[]{bitmap}, null, changeQuickRedirect, true, 101209, new Class[]{Bitmap.class}, i.class); if (proxy.isSupported) { return (i) proxy.result; } i iVar = new i(); iVar.r(bitmap); return iVar; } public static String e() { PatchProxyResult proxy = PatchProxy.proxy(new Object[0], null, changeQuickRedirect, true, 101206, new Class[0], String.class); if (proxy.isSupported) { return (String) proxy.result; } if (!a.a(ServiceManager.o().getCommunityInitViewModel().getSnsShareUrl())) { return ServiceManager.o().getCommunityInitViewModel().getSnsShareUrl(); } return qc.f.g(); } public static void f(i iVar, CommunityFeedModel communityFeedModel, String str) { if (!PatchProxy.proxy(new Object[]{iVar, communityFeedModel, str}, null, changeQuickRedirect, true, 101212, new Class[]{i.class, CommunityFeedModel.class, String.class}, Void.TYPE).isSupported) { String format = String.format(e() + "hybird/h5community/column" + "?postsId=%1$s&shareId=%2$s&source=article&shareType=0", communityFeedModel.getContent().getContentId(), str); String str2 = communityFeedModel.getUsername() + "在得物APP发布了一条热门内容!快来围观,就等你啦!"; String str3 = communityFeedModel.getContent().getTitle() + format + " " + "(分享自 @得物APP)"; iVar.G(!TextUtils.isEmpty(communityFeedModel.getContent().getTitle()) ? communityFeedModel.getContent().getTitle() : "我分享了来自得物APP的内容"); iVar.C(str2); iVar.s(communityFeedModel.getContent().getTitle()); iVar.D(str3); if (!a.c(communityFeedModel.getContent().getMediaListModel())) { iVar.u(((MediaItemModel) h.a.j(communityFeedModel, 0)).getOriginUrl()); } iVar.F(format); } } public static void g(i iVar, CommunityFeedModel communityFeedModel, String str) { String str2; String str3; if (!PatchProxy.proxy(new Object[]{iVar, communityFeedModel, str}, null, changeQuickRedirect, true, 101211, new Class[]{i.class, CommunityFeedModel.class, String.class}, Void.TYPE).isSupported) { if (a.a(str)) { str2 = e() + "rn-activity/community-share" + "?trendId=" + communityFeedModel.getContent().getContentId(); } else { str2 = String.format(e() + "rn-activity/community-share" + "?trendId=%1$s&shareId=%2$s&source=%3$s", communityFeedModel.getContent().getContentId(), str, "picTrend"); } String str4 = communityFeedModel.getUsername() + " 在得物App发起了投票,快来参与!"; String titleAndContent = communityFeedModel.getContent().getTitleAndContent(); String str5 = "邀请你参与投票"; if (TextUtils.isEmpty(titleAndContent)) { str3 = a0.b.f(str5, str2, " ", "(分享自 @得物APP)"); titleAndContent = str5; } else { str5 = a40.f.g("得物App投票 | ", titleAndContent); StringBuilder n = h.a.n("「", titleAndContent, "」得物App投票", str2, " "); n.append("(分享自 @得物APP)"); str3 = n.toString(); } iVar.G(titleAndContent.toString()); iVar.C(str4); iVar.s(str5); iVar.D(str3); if (!a.c(communityFeedModel.getContent().getMediaListModel())) { iVar.u(((MediaItemModel) h.a.j(communityFeedModel, 0)).getOriginUrl()); } iVar.F(str2); } } public static void h(i iVar, CommunityFeedModel communityFeedModel, String str) { String str2; String str3; if (!PatchProxy.proxy(new Object[]{iVar, communityFeedModel, str}, null, changeQuickRedirect, true, 101214, new Class[]{i.class, CommunityFeedModel.class, String.class}, Void.TYPE).isSupported) { if (communityFeedModel.getContent().getDpInfo() != null) { str2 = e() + "h5-sociality/community/comment-detail" + "?contentId=" + communityFeedModel.getContent().getContentId(); } else if (a.a(str)) { str2 = e() + "rn-activity/community-share" + "?trendId=" + communityFeedModel.getContent().getContentId(); } else { str2 = String.format(e() + "rn-activity/community-share" + "?trendId=%1$s&shareId=%2$s&source=%3$s&shareType=0", communityFeedModel.getContent().getContentId(), str, "picTrend"); } String str4 = communityFeedModel.getUsername() + "在得物App发布了一条热门动态!快来围观,就等你啦!"; String str5 = "我分享了来自得物App的照片"; String titleAndContent = communityFeedModel.getContent().getTitleAndContent(); if (TextUtils.isEmpty(titleAndContent)) { str3 = communityFeedModel.getUsername() + "在得物App发布了一条热门动态!快来围观,就等你啦!" + str2 + " " + "(分享自 @得物APP)"; } else { if (!TextUtils.isEmpty(communityFeedModel.getContent().getTitle())) { str5 = communityFeedModel.getContent().getTitle(); } if (!TextUtils.isEmpty(communityFeedModel.getContent().getNotNullContent())) { str4 = communityFeedModel.getContent().getNotNullContent(); } StringBuilder g3 = h.g("「", titleAndContent, "」"); g3.append(communityFeedModel.getUsername()); g3.append("在得物App发布了一条热门动态!快来围观,就等你啦!"); g3.append(str2); g3.append(" "); g3.append("(分享自 @得物APP)"); str3 = g3.toString(); } if (communityFeedModel.getContent().getDpInfo() != null) { str5 = communityFeedModel.getUsername() + "正在点评 " + (!communityFeedModel.getContent().getSafeLabel().getAllSpuList().isEmpty() ? StringUtils.i(communityFeedModel.getContent().getSafeLabel().getAllSpuList().get(0).getTitle()) : ""); str4 = "看点评,购好物"; } iVar.G(str5); iVar.C(str4); iVar.D(str3); if (a.c(communityFeedModel.getContent().getMediaListModel())) { iVar.A(R.mipmap.du_logo_small); } else { iVar.u(((MediaItemModel) h.a.j(communityFeedModel, 0)).getOriginUrl()); } iVar.F(str2); } } public static void i(i iVar, CommunityFeedModel communityFeedModel, String str) { String str2; String sb2; if (!PatchProxy.proxy(new Object[]{iVar, communityFeedModel, str}, null, changeQuickRedirect, true, 101213, new Class[]{i.class, CommunityFeedModel.class, String.class}, Void.TYPE).isSupported) { if (a.a(str)) { str2 = e() + "rn-activity/community-share" + "?trendId=" + communityFeedModel.getContent().getContentId(); } else { str2 = String.format(e() + "rn-activity/community-share" + "?trendId=%1$s&shareId=%2$s&source=%3$s&shareType=0", communityFeedModel.getContent().getContentId(), str, "videoTrend"); } String str3 = communityFeedModel.getUsername() + "在得物APP发布了一条热门动态!快来围观,就等你啦!"; String str4 = "我分享了来自得物APP的视频"; String titleAndContent = communityFeedModel.getContent().getTitleAndContent(); if (TextUtils.isEmpty(titleAndContent)) { titleAndContent = communityFeedModel.getUsername() + " 在得物App发布了小视频,快来围观!"; sb2 = communityFeedModel.getUsername() + "在得物App发布了小视频,快来围观!" + str2 + " " + "(分享自 @得物APP)"; } else { String title = communityFeedModel.getContent().getTitle(); String notNullContent = communityFeedModel.getContent().getNotNullContent(); if (!TextUtils.isEmpty(title)) { str4 = title; } if (!TextUtils.isEmpty(notNullContent)) { str3 = notNullContent; } StringBuilder g3 = h.g("「", titleAndContent, "」"); g3.append(communityFeedModel.getUsername()); g3.append("在得物App发布了小视频,快来围观!"); g3.append(str2); g3.append(" "); g3.append("(分享自 @得物APP)"); sb2 = g3.toString(); } Pair<Boolean, String> videoCover = communityFeedModel.getContent().getVideoCover(); String second = videoCover != null ? videoCover.getSecond() : ""; iVar.w(false); PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Byte((byte) 1)}, iVar, i.changeQuickRedirect, false, 321893, new Class[]{Boolean.TYPE}, i.class); if (proxy.isSupported) { i iVar2 = (i) proxy.result; } else { iVar.f37019q = true; } iVar.u(second); iVar.G(str4); iVar.C(str3); iVar.s(titleAndContent); iVar.D(sb2); iVar.F(str2); } } }