private static string GetCaption(TLPushData data) { var loc_key = data.loc_key; if (loc_key == null) { return("locKey=null"); } if (loc_key.StartsWith("CHAT") || loc_key.StartsWith("GEOCHAT")) { return(data.loc_args[1]); } if (loc_key.StartsWith("MESSAGE")) { return(data.loc_args[0]); } if (loc_key.StartsWith("CHANNEL")) { return(data.loc_args[0]); } if (loc_key.StartsWith("PINNED")) { return(data.loc_args[0]); } if (loc_key.StartsWith("AUTH") || loc_key.StartsWith("CONTACT") || loc_key.StartsWith("ENCRYPTED") || loc_key.StartsWith("ENCRYPTION")) { return("Telegram"); } return("Telegram"); }
private static string GetLaunch(TLPushData data) { var loc_key = data.loc_key; if (loc_key == null) { return(null); } var list = new List <string> { "Action=" + loc_key }; list.AddRange(data.custom.GetParams()); return(string.Join("&", list)); }
private static string GetMessage(TLPushData data) { var loc_key = data.loc_key; if (loc_key == null) { return(string.Empty); } //string text; //if (_locKeys.TryGetValue(loc_key, out text)) //{ // return string.Format(text, data.loc_args); //} var resourceLoader = ResourceLoader.GetForViewIndependentUse("Unigram.Tasks/Resources"); var text = resourceLoader.GetString(loc_key); if (text != string.Empty) { return(string.Format(text, data.loc_args).Replace("\r\n", "\n").Replace("\n", " ")); } var stringBuilder = new StringBuilder(); if (data.loc_args != null) { stringBuilder.AppendLine("loc_args"); string[] loc_args = data.loc_args; for (int i = 0; i < loc_args.Length; i++) { string text2 = loc_args[i]; stringBuilder.AppendLine(text2); } } return(string.Empty); }
private static bool IsServiceNotification(TLPushData data) { return(data.loc_key == "DC_UPDATE"); }
private static bool IsMuted(TLPushData data) { return(data.mute == "1"); }
private static string GetTag(TLPushData data) { return(data.tag); }
private static string GetGroup(TLPushData data) { return(data.group); }
private static string GetSound(TLPushData data) { return(data.sound); }