export interface NextcloudConversation {
  token: string;
  displayName: string;
  unreadMessages: number;
  lastActivity: number;
  lastMessage: {
    text: string;
    author: string;
    timestamp: number;
  } | null;
  type: number;
  url: string;
}

export interface NextcloudTalkData {
  connected: boolean;
  totalUnread?: number;
  conversations?: NextcloudConversation[];
}

export interface NextcloudConnectData {
  loginUrl: string;
  pollToken: string;
  pollEndpoint: string;
}

export interface NextcloudPollData {
  completed: boolean;
}

export interface NextcloudMessage {
  id: number;
  token: string;
  actorType: string;
  actorId: string;
  actorDisplayName: string;
  message: string;
  timestamp: number;
  messageType: string;
  systemMessage: string;
  messageParameters?: Record<string, any>;
  parent?: NextcloudMessage;
  reactions?: Record<string, number>;
  reactionsSelf?: string[];
}

export interface NextcloudRoomListData {
  connected: boolean;
  rooms: NextcloudConversation[];
  loginName?: string;
}

export interface NextcloudUser {
  id: string;
  label: string;
  source: string;
}

export interface NextcloudReaction {
  actorDisplayName: string;
  actorId: string;
  actorType: string;
  timestamp: number;
}

export interface NextcloudPoll {
  id: number;
  question: string;
  options: string[];
  votes: Record<string, number[]>;
  numVoters: number;
  resultMode: number;
  maxVotes: number;
  votedSelf?: number[];
  status: number;
}
