Beispiel #1
0
        protected override IEnumerable <KeyValuePair <string, object> > GetClientVariables(HttpContext context)
        {
            var config = new TalkConfiguration();

            return(new List <KeyValuePair <string, object> >(2)
            {
                RegisterObject(new
                {
                    Icons = new
                    {
                        addonIcon16 = WebImageSupplier.GetAbsoluteWebPath("talk16.png", TalkAddon.AddonID),
                        addonIcon32 = WebImageSupplier.GetAbsoluteWebPath("talk32.png", TalkAddon.AddonID),
                        addonIcon48 = WebImageSupplier.GetAbsoluteWebPath("talk48.png", TalkAddon.AddonID),
                        addonIcon128 = WebImageSupplier.GetAbsoluteWebPath("talk128.png", TalkAddon.AddonID),
                        iconNewMessage = WebImageSupplier.GetAbsoluteWebPath("icon-new-message.ico", TalkAddon.AddonID)
                    }
                }),
                RegisterObject(new
                {
                    Config = new
                    {
                        validSymbols = config.ValidSymbols ?? "",
                        historyLength = config.HistoryLength ?? "",
                        boshUri = config.BoshUri,
                        jabberAccount = GetJabberAccount(),
                        resourcePriority = config.ResourcePriority,
                        clientInactivity = config.ClientInactivity,
                        addonID = TalkAddon.AddonID,
                        enabledMassend = config.EnabledMassend.ToString().ToLower(),
                        enabledConferences = config.EnabledConferences.ToString().ToLower(),
                        requestTransportType = config.RequestTransportType ?? string.Empty,
                        fileTransportType = config.FileTransportType ?? string.Empty,
                        maxUploadSize = SetupInfo.MaxImageUploadSize,
                        sounds = WebPath.GetPath("/addons/talk/swf/sounds.swf"),
                        soundsHtml = new List <string>()
                        {
                            WebPath.GetPath("/addons/talk/swf/startupsound.mp3"),
                            WebPath.GetPath("/addons/talk/swf/incmsgsound.mp3"),
                            WebPath.GetPath("/addons/talk/swf/letupsound.mp3"),
                            WebPath.GetPath("/addons/talk/swf/sndmsgsound.mp3"),
                            WebPath.GetPath("/addons/talk/swf/statussound.mp3")
                        },
                        fullText = FactoryIndexer <JabberWrapper> .CanSearchByContent()
                    }
                })
            });
        }
Beispiel #2
0
 protected override string GetCacheHash()
 {
     return(ClientSettings.ResetCacheKey + SecurityContext.CurrentAccount.ID + FactoryIndexer <JabberWrapper> .CanSearchByContent() +
            (SecurityContext.IsAuthenticated && !CoreContext.Configuration.Personal
                 ? (CoreContext.UserManager.GetMaxUsersLastModified().Ticks.ToString(CultureInfo.InvariantCulture) +
                    CoreContext.UserManager.GetMaxGroupsLastModified().Ticks.ToString(CultureInfo.InvariantCulture))
                 : string.Empty));
 }