Exemple #1
0
        private bool PreProcessLink(string arg)
        {
            try
            {
                arg = arg.TrimEnd('/'); // copy so modifications arent permanent

                if (arg.Contains("/file/"))
                {
                    FileLink link = FileLink.Decode(arg, null);

                    var ui = FindCoreUI(link.PublicOpID);

                    if (ui != null)
                    {
                        ShareService share = ui.Core.GetService(DeOps.Services.ServiceIDs.Share) as ShareService;
                        share.DownloadLink(arg);

                        if (ui.GuiMain != null && !ui.GuiMain.ShowExistingView(typeof(SharingView)))
                        {
                            ui.ShowView(new SharingView(ui.Core, ui.Core.UserID), true);
                        }

                        return(true);
                    }
                }

                else if (arg.Contains("/ident/"))
                {
                    IdentityLink link = IdentityLink.Decode(arg);

                    var target = FindCoreUI(link.PublicOpID);

                    if (target != null)
                    {
                        BuddyView.AddBuddyDialog(target.Core, arg);
                        return(true);
                    }
                }
            }
            catch { }

            return(false);
        }