private static void SyncIMAccount(ThirdIMAccount source)
        {
            var imAccount = ThirdIMAccount.CreateNew(source.PassportId, source.Platform, source.PlatformAccountId);

            imAccount.Nickname = source.Nickname;

            if (null == imAccount)
            {
                return;
            }

            if (imAccount.IsSync)
            {
                ObjectIOCFactory.GetSingleton <IIMProvider>(ModuleEnvironment.IMProviderName).ChangeNickname(imAccount);
            }
            else
            {
                var isSync = ObjectIOCFactory.GetSingleton <IIMProvider>(ModuleEnvironment.IMProviderName).CreateAccount(imAccount);
                if (isSync)
                {
                    imAccount.IsSync = isSync;
                    imAccount.Save();
                }
            };
        }
Example #2
0
        public void aa()
        {
            var passportId        = 121353430;
            var platformAccountId = string.Concat("im-", passportId);


            var imAccount = ThirdIMAccount.CreateNew(passportId, ModuleEnvironment.IMProviderName, platformAccountId);

            if (null != imAccount && false == imAccount.IsSync)
            {
                var isSync = ObjectIOCFactory.GetSingleton <IIMProvider>(ModuleEnvironment.IMProviderName).CreateAccount(imAccount);
                if (isSync)
                {
                    imAccount.IsSync = isSync;
                    imAccount.Save();
                }
            }
        }