/**
         * API: buddies by ids
         *
         * @param buddy id array
         *
         * @return Buddy list
         *
         */

        public IEnumerable <WebimEndpoint> BuddiesByIds(string uid, string[] ids)
        {
            List <WebimEndpoint> buddies = new List <WebimEndpoint>();
            WebimEndpoint        e       = new WebimEndpoint("1", "user1");

            e.Avatar = "/static/images/male.png";
            buddies.Add(e);
            e        = new WebimEndpoint("2", "user2");
            e.Avatar = "/static/images/female.png";
            buddies.Add(e);
            return(buddies);
        }
        /**
         * API: current user
         *
         * 返回当前的Webim端点(用户)
         */
        public WebimEndpoint Endpoint()
        {
            // TODO: 应替换该代码,返回集成系统的当前用户。
            WebimEndpoint ep = new WebimEndpoint("1", "user1");

            ep.Avatar   = "/static/images/male.png";
            ep.Presence = "online";
            ep.Show     = "available";
            ep.Url      = "#"; // 用户空间
            ep.Status   = "";  // 用户状态
            return(ep);
        }
        /**
         * API: Buddies of current user.
         *
         * Buddy:
         *
         *  id:         uid
         *  uid:        uid
         *  nick:       nick
         *  avatar:    url of photo
         *  presence:   online | offline
         *  show:       available | unavailable | away | busy | hidden
         *  url:        url of home page of buddy
         *  status:     buddy status information
         *  group:      group of buddy
         *
         * @param string current uid
         *
         * @return Buddy list
         *
         */
        public IEnumerable <WebimEndpoint> Buddies(string uid)
        {
            //TODO: STUB CODE
            List <WebimEndpoint> buddies = new List <WebimEndpoint>();
            WebimEndpoint        e       = new WebimEndpoint("1", "user1");

            e.Avatar = "/static/images/male.png";
            buddies.Add(e);
            e        = new WebimEndpoint("2", "user2");
            e.Avatar = "/static/images/female.png";
            buddies.Add(e);
            return(buddies);
        }
Esempio n. 4
0
 public WebimController()
 {
     this.model    = new WebimModel();
     this.plugin   = new WebimPlugin();
     this.endpoint = this.plugin.Endpoint();
 }