TelegramTUI/src/viewchat.cpp

30 lines
459 B
C++

#include "viewchat.h"
#include <ncurses.h>
ViewChat::ViewChat(TgTUI& tgtui) : View(tgtui) {}
ViewChat::~ViewChat() {}
void ViewChat::setChat(const SlimChat* chat) {
this->chat = chat;
}
int64_t ViewChat::getChat() const {
return this->chat->chatId;
}
void ViewChat::paint() {
::printw("Chat: %s (%li)\n", chat->name.c_str(), chat->chatId);
}
int ViewChat::keyIn(int key) {
switch (key) {
case KEY_LEFT:
case 'q':
return 0;
}
return -1;
}