public MessageClass[] GetRecentMessages(string calleeUserName, int id) { try { var userName = CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID).UserName; var recentMessages = new JabberServiceClient().GetRecentMessages(calleeUserName, id); if (recentMessages == null) { return(null); } foreach (var mc in recentMessages) { mc.DateTime = TenantUtil.DateTimeFromUtc(mc.DateTime.AddMilliseconds(1)); if (mc.UserName == null || string.Equals(mc.UserName, calleeUserName, StringComparison.InvariantCultureIgnoreCase)) { mc.UserName = calleeUserName; } else { mc.UserName = userName; } } return(recentMessages); } catch { } return(new MessageClass[0]); }
public TalkConfiguration() { JabberClientConfiguration cfg = null; try { cfg = new JabberServiceClient().GetClientConfiguration(CoreContext.TenantManager.GetCurrentTenant().TenantId); } catch { } RequestTransportType = WebConfigurationManager.AppSettings["RequestTransportType"] ?? "flash"; ServerAddress = WebConfigurationManager.AppSettings["JabberAddress"] ?? (cfg != null ? cfg.Domain : string.Empty); ServerName = cfg != null ? cfg.Domain : ServerAddress; ServerPort = WebConfigurationManager.AppSettings["JabberPort"] ?? (cfg != null ? cfg.Port : 5222).ToString(); if (WebConfigurationManager.AppSettings["BoshPath"] != null) { if (RequestTransportType == "handler") { BoshUri = VirtualPathUtility.ToAbsolute(TalkAddon.BaseVirtualPath + "/http-poll/default.aspx"); } else { BoshUri = string.Format(WebConfigurationManager.AppSettings["BoshPath"], ServerAddress); } } else if (cfg != null && cfg.BoshUri != null) { BoshUri = cfg.BoshUri.ToString(); } else { BoshUri = string.Empty; } try { UserName = CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID).UserName.ToLowerInvariant(); } catch { UserName = string.Empty; } Jid = string.Format("{0}@{1}", UserName, ServerName).ToLowerInvariant(); FileTransportType = WebConfigurationManager.AppSettings["FileTransportType"] ?? "flash"; // in seconds UpdateInterval = WebConfigurationManager.AppSettings["UpdateInterval"] ?? "3600"; OverdueInterval = WebConfigurationManager.AppSettings["OverdueInterval"] ?? "60"; EnabledHistory = (WebConfigurationManager.AppSettings["History"] ?? "on") == "on"; EnabledMassend = (WebConfigurationManager.AppSettings["Massend"] ?? "on") == "on"; EnabledConferences = (WebConfigurationManager.AppSettings["Conferences"] ?? "on") == "on"; EnabledFirebugLite = (WebConfigurationManager.AppSettings["FirebugLite"] ?? "off") == "on"; ValidSymbols = WebConfigurationManager.AppSettings["ValidSymbols"] ?? "äöüßña-žа-я"; HistoryLength = WebConfigurationManager.AppSettings["HistoryLength"] ?? "10"; ResourcePriority = WebConfigurationManager.AppSettings["ResourcePriority"] ?? "60"; ClientInactivity = WebConfigurationManager.AppSettings["ClientInactivity"] ?? "90"; }
public void SetUp() { jabberClient = new JabberServiceClient(); }