// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.olio.communication.notifications.mappers.rule; import android.content.Context; import com.olio.communication.messages.MessageBuilder; import com.olio.communication.notifications.new_notifications.StreamItem; import com.olio.communication.notifications.new_notifications.StreamItemBuilder; import com.olio.data.object.assistant.ActiveRemindMeLater; import com.olio.data.object.assistant.rule.SilenceNotificationsRule; import com.olio.data.object.user.FavoriteContacts; import com.olio.data.object.user.OlioContact; import com.olio.server.RequestManager; import com.olio.util.ALog; import java.util.Calendar; import java.util.Iterator; import java.util.List; import org.apache.commons.lang3.StringUtils; // Referenced classes of package com.olio.communication.notifications.mappers.rule: // NotificationCategoryContextualRuleMapper public class SilenceNotificationRuleMapper extends NotificationCategoryContextualRuleMapper { public static final String LATER_STREAM_REMIND_ME_LATER_ID = "laterStreamRemindMeLaterId"; private static final String REMINDERS_TITLE = "REMINDERS"; public SilenceNotificationRuleMapper(Context context, SilenceNotificationsRule silencenotificationsrule) { super(context, silencenotificationsrule); } protected void categoryMatchedApplyRule(StreamItemBuilder streamitembuilder) { if (((SilenceNotificationsRule)rule).getExceptions() == null || !((SilenceNotificationsRule)rule).getExceptions().contains("vip")) goto _L2; else goto _L1 _L1: Iterator iterator = FavoriteContacts.get(contentResolver).getFavoriteContacts().iterator(); _L5: if (!iterator.hasNext()) goto _L2; else goto _L3 _L3: OlioContact oliocontact; String s; oliocontact = (OlioContact)iterator.next(); s = streamitembuilder.build().getOverviewTopText(); if (s == null || oliocontact == null || !StringUtils.containsIgnoreCase(s, oliocontact.getName()) && !StringUtils.containsIgnoreCase(s, (new StringBuilder()).append(oliocontact.getFirstName()).append(" ").append(oliocontact.getLastName()).toString())) goto _L5; else goto _L4 _L4: ALog.d("SilenceNotificationRuleMapper: rule mapper hit the VIP exception, do not set silent", new Object[0]); _L7: return; _L2: ALog.d("SilenceNotificationRuleMapper: Rule mapper, setting this notification to silent", new Object[0]); streamitembuilder.setSilenced(); if (((SilenceNotificationsRule)rule).getRemind() != null && ((SilenceNotificationsRule)rule).getRemind().contains("remind")) { ALog.e("SilenceNotificationRuleMapper: has a remind", new Object[0]); (new ActiveRemindMeLater(streamitembuilder.build().getNotificationId(), null, streamitembuilder.build().getNotificationCategory(), ((SilenceNotificationsRule)rule).getObjectId())).save(contentResolver); int i = ActiveRemindMeLater.activeRemindMeLaters(contentResolver).size(); if (i == 1) { streamitembuilder = String.format("You have 1 active reminder", new Object[0]); } else { streamitembuilder = String.format("You have %s active reminders", new Object[] { Integer.valueOf(i) }); } RequestManager.enqueueRequest(context, (new MessageBuilder()).setAction(com.olio.communication.messages.Message.Action.CREATE_OR_UPDATE).setDestination("watch").setSource("watch").setPayload((new StreamItemBuilder()).setDateCreated(Calendar.getInstance().getTime()).setOverviewTopText("REMINDERS").setOverviewBottomText(streamitembuilder).setDetailTitle("REMINDERS").setDetailText(streamitembuilder).setStreamType(com.olio.communication.notifications.new_notifications.StreamItem.StreamType.LATER).setVibrationType(com.olio.communication.notifications.new_notifications.StreamItem.VibrationType.NONE).setDisplayType(com.olio.communication.notifications.new_notifications.StreamItem.DisplayType.LAUNCH_NONE).setNotificationCategory(com.olio.communication.notifications.NotificationFilters.Category.REMINDER).setNotificationId("laterStreamRemindMeLaterId").build()).build()); return; } if (true) goto _L7; else goto _L6 _L6: } public String toString() { return (new StringBuilder()).append("SilenceNotificationRuleMapper{} ").append(super.toString()).toString(); } }