1 // Smuxi - Smart MUltipleXed Irc 2 // 3 // Copyright (c) 2012 Carlos Martín Nieto <cmn@dwim.me> 4 // 5 // Full GPL License: <http://www.gnu.org/licenses/gpl.txt> 6 // 7 // This program is free software; you can redistribute it and/or modify 8 // it under the terms of the GNU General Public License as published by 9 // the Free Software Foundation; either version 2 of the License, or 10 // (at your option) any later version. 11 // 12 // This program is distributed in the hope that it will be useful, 13 // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 // GNU General Public License for more details. 16 // 17 // You should have received a copy of the GNU General Public License 18 // along with this program; if not, write to the Free Software 19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 using System; 21 22 namespace Smuxi.Engine.Campfire 23 { 24 internal class UserResponse { public User User { get; set; } } 25 internal class RoomsResponse { public Room[] Rooms { get; set; } } 26 internal class RoomResponse { public Room Room { get; set; } } 27 internal class MessagesResponse { public Message[] Messages { get; set; } } 28 internal class MessageResponse { public Message Message { get; set; } } 29 internal class MessageWrapper { public MessageSending message { get; set; } } 30 internal class TopicChange { public string topic { get; set; } } 31 internal class UpdateTopicWrapper { public TopicChange room { get; set; } } 32 internal class UploadWrapper { public Upload Upload { get; set; } } 33 internal class UploadsResponse { public Upload[] Uploads { get; set; } } 34 35 internal enum MessageType { 36 UnknownMessage, 37 EnterMessage, 38 KickMessage, 39 LeaveMessage, 40 TimestampMessage, 41 TextMessage, 42 PasteMessage, 43 SoundMessage, 44 LockMessage, 45 UnlockMessage, 46 TopicChangeMessage, 47 TweetMessage, 48 UploadMessage, 49 } 50 51 internal class Room { 52 public string Topic { get; set; } 53 public string Name { get; set; } 54 public int Id { get; set; } 55 public bool Locked { get; set; } 56 public int MembershipLimit { get; set; } 57 public DateTime CreatedAt { get; set; } 58 public DateTime UpdatedAt { get; set; } 59 public User[] Users { get; set; } 60 } 61 62 internal class User { 63 public int Id { get; set; } 64 public string Name { get; set; } 65 public string Email_Address { get; set; } 66 public bool Admin { get; set; } 67 public DateTimeOffset Created_At { get; set; } 68 public string Type { get; set; } 69 public string Avatar_Url { get; set; } 70 public string Api_Auth_Token { get; set; } 71 } 72 73 internal class MessageSending { 74 public string body { get; set; } 75 } 76 77 internal class Tweet { 78 public long Id { get; set; } 79 public string Message { get; set; } 80 public string Author_Username { get; set; } 81 public string Author_Avatar_Url { get; set; } 82 } 83 84 internal class Message { 85 public int Id { get; set; } 86 public string Body { get; set; } 87 public int Room_Id { get; set; } 88 public int User_Id { get; set; } 89 public DateTimeOffset Created_At { get; set; } 90 public MessageType Type { get; set; } 91 public bool Starred { get; set; } 92 public Tweet Tweet { get; set; } 93 } 94 95 internal class Upload { 96 public int Id { get; set; } 97 public int Room_Id { get; set; } 98 public string Name { get; set; } 99 public string Full_Url { get; set; } 100 public DateTimeOffset Created_At { get; set; } 101 public string Content_Type { get; set; } 102 public int User_Id { get; set; } 103 public int Byte_Size { get; set; } 104 } 105 } 106