示例#1
0
        public PartialFindResult <UserMessageContract> GetMessages(
            int id,
            UserInboxType?inbox = null,
            bool unread         = false,
            int start           = 0,
            int maxResults      = 10,
            bool getTotalCount  = false)
        {
            if (id != permissionContext.LoggedUserId)
            {
                throw new HttpForbiddenException();
            }

            return(messageQueries.GetList(permissionContext.LoggedUserId, new PagingProperties(start, maxResults, getTotalCount),
                                          inbox ?? UserInboxType.Nothing, unread, userIconFactory));
        }
示例#2
0
        public ActionResult <PartialFindResult <UserMessageContract> > GetMessages(
            int id,
            UserInboxType?inbox = null,
            bool unread         = false,
            int?anotherUserId   = null,
            int start           = 0,
            int maxResults      = 10,
            bool getTotalCount  = false)
        {
            if (id != _permissionContext.LoggedUserId)
            {
                return(Forbid());
            }

            return(_messageQueries.GetList(_permissionContext.LoggedUserId, new PagingProperties(start, maxResults, getTotalCount),
                                           inbox ?? UserInboxType.Nothing, unread, anotherUserId, _userIconFactory));
        }
示例#3
0
 private UserMessagesContract CallGetList(bool unread = false)
 {
     return(queries.GetList(receiver.Id, new PagingProperties(0, 10, false), unread, new FakeUserIconFactory()));
 }
示例#4
0
        public ActionResult MessagesJson(int maxCount = 100, int start = 0, bool unread = false, int iconSize = 20)
        {
            var messages = messageQueries.GetList(LoggedUserId, new PagingProperties(start, maxCount, false), unread, new GravatarUserIconFactory(iconSize));

            return(LowercaseJson(messages));
        }
示例#5
0
 private PartialFindResult <UserMessageContract> CallGetList(UserInboxType inboxType, bool unread = false)
 {
     return(queries.GetList(receiver.Id, new PagingProperties(0, 10, true), inboxType, unread, null, new FakeUserIconFactory()));
 }