Exemple #1
0
        public bool SendNormalMessage(bool ignoreProfileMessageRules, bool ignoreProfileEmailRules)
        {
            //Check if the receiver has blocked the sender
            if (!FriendHandler.IsBlocked(_UserId, _FromUserID))
            {
                //Check if the sender is a friend of the receiver
                if (FriendHandler.IsFriend(_UserId, _FromUserID))
                {
                    _TypOfMessage = (int)MessageTypes.FriendMessage;
                }
                else
                {
                    _TypOfMessage = (int)MessageTypes.NormalMessage;
                }

                MembershipUser objToUser = Membership.GetUser(_UserId, false);

                ReceiveMessageFrom rmfUserSetting = DataObjectUser.GetAllowedMessages(_UserId);
                if (ignoreProfileMessageRules || rmfUserSetting == ReceiveMessageFrom.All || (rmfUserSetting == ReceiveMessageFrom.Friends && _TypOfMessage == (int)MessageTypes.FriendMessage))
                {
                    Save();
                    if (ignoreProfileEmailRules || DataObjectUser.GetSendEmailOnMessage(_UserId) == YesNo.Yes)
                    {
                        MembershipUser objFromUser    = Membership.GetUser(_FromUserID, false);
                        string         messageCulture = !string.IsNullOrEmpty(UserProfile.GetProfile(objToUser.UserName).PrefferedCulture) ? UserProfile.GetProfile(objToUser.UserName).PrefferedCulture : SiteConfig.DefaultLanguage;
                        SendMail(objFromUser.UserName, objToUser, GuiLanguage.GetGuiLanguage("Pages.Popups.WebUI.Base", messageCulture).GetString("LableMessagePrivateMessage"), GuiLanguage.GetGuiLanguage("Templates", messageCulture).GetString("EmailNewMessageReceived"));
                    }
                }
            }
            return(true);
        }
Exemple #2
0
        public bool SendInviteMessage()
        {
            //Check if the receiver has blocked the sender
            if (!FriendHandler.IsBlocked(_UserId, _FromUserID))
            {
                _TypOfMessage = (int)MessageTypes.InviteToCommunity;
                Save();
                MembershipUser objToUser = Membership.GetUser(_UserId, false);

                if (DataObjectUser.GetSendEmailOnMessage(_UserId) == YesNo.Yes)
                {
                    MembershipUser objFromUser = Membership.GetUser(_FromUserID, false);
                    SendMail(objFromUser.UserName, objToUser, "Einladung zur Privat-Community", GuiLanguage.GetGuiLanguage("Templates").GetString("EmailNewInvitationToCommunity"));
                }
            }
            return(true);
        }
Exemple #3
0
        public bool SendRequestsMessage()
        {
            //Check if the receiver has blocked the sender
            if (!FriendHandler.IsBlocked(_UserId, _FromUserID))
            {
                _TypOfMessage = (int)MessageTypes.FriendRequest;
                Save();
                MembershipUser objToUser = Membership.GetUser(_UserId, false);

                if (DataObjectUser.GetSendEmailOnMessage(_UserId) == YesNo.Yes)
                {
                    MembershipUser objFromUser = Membership.GetUser(_FromUserID, false);
                    SendMail(objFromUser.UserName, objToUser, GuiLanguage.GetGuiLanguage("Shared").GetString("CommandFriendshipQuery"), GuiLanguage.GetGuiLanguage("Templates").GetString("EmailNewFriendRequestReceived"));
                }
            }
            return(true);
        }
Exemple #4
0
        public bool SendInviteMessage()
        {
            //Check if the receiver has blocked the sender
            if (!FriendHandler.IsBlocked(_UserId, _FromUserID))
            {
                _TypOfMessage = (int)MessageTypes.InviteToCommunity;
                Save();
                MembershipUser objToUser = Membership.GetUser(_UserId, false);

                if (DataObjectUser.GetSendEmailOnMessage(_UserId) == YesNo.Yes)
                {
                    MembershipUser objFromUser    = Membership.GetUser(_FromUserID, false);
                    string         messageCulture = !string.IsNullOrEmpty(UserProfile.GetProfile(objToUser.UserName).PrefferedCulture) ? UserProfile.GetProfile(objToUser.UserName).PrefferedCulture : SiteConfig.DefaultLanguage;
                    SendMail(objFromUser.UserName, objToUser, "Einladung zur Privat-Community", GuiLanguage.GetGuiLanguage("Templates", messageCulture).GetString("EmailNewInvitationToCommunity"));
                }
            }
            return(true);
        }
Exemple #5
0
        public bool SendRequestsMessage()
        {
            //Check if the receiver has blocked the sender
            if (!FriendHandler.IsBlocked(_UserId, _FromUserID))
            {
                _TypOfMessage = (int)MessageTypes.FriendRequest;
                Save();
                MembershipUser objToUser = Membership.GetUser(_UserId, false);

                if (DataObjectUser.GetSendEmailOnMessage(_UserId) == YesNo.Yes)
                {
                    MembershipUser objFromUser    = Membership.GetUser(_FromUserID, false);
                    string         messageCulture = !string.IsNullOrEmpty(UserProfile.GetProfile(objToUser.UserName).PrefferedCulture) ? UserProfile.GetProfile(objToUser.UserName).PrefferedCulture : SiteConfig.DefaultLanguage;
                    SendMail(objFromUser.UserName, objToUser, GuiLanguage.GetGuiLanguage("Shared", messageCulture).GetString("CommandFriendshipQuery"), GuiLanguage.GetGuiLanguage("Templates", messageCulture).GetString("EmailNewFriendRequestReceived"));
                }
            }
            return(true);
        }