From 9ebc3e3f5cf4847239d04cf5b3b01d0b1855a039 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 7 May 2018 06:34:22 +0200 Subject: Continue text edit, add avatar (image, but not way to change avatar) --- src/Channel.cpp | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'src/Channel.cpp') diff --git a/src/Channel.cpp b/src/Channel.cpp index 2bd1b0b..185c544 100644 --- a/src/Channel.cpp +++ b/src/Channel.cpp @@ -19,21 +19,11 @@ namespace dchat localUser(_localUser ? _localUser : new OfflineUser("You")) { addUserLocally(localUser); - { - Message *message = new Message(&systemUser, u8"[emoji](https://discordemoji.com/assets/emoji/PepeDab.gif) deaf [emoji](https://discordemoji.com/assets/emoji/COGGERS.gif)"); - messageBoard.addMessage(message); - } - - { - Message *message = new Message(&systemUser, u8"[emoji](https://discordemoji.com/assets/emoji/PepeDab.gif)[emoji](https://discordemoji.com/assets/emoji/COGGERS.gif)"); - messageBoard.addMessage(message); - } - - { - Message *message = new Message(&systemUser, u8"pepedab https://discordemoji.com/assets/emoji/PepeDab.gif coggers https://discordemoji.com/assets/emoji/COGGERS.gif check out this url http://www.grandtournation.com/6808/start-date-of-the-grand-tour-season-3-confirmed-mark-your-calendars/ owo"); - message->text.setEditable(true); - messageBoard.addMessage(message); - } + localUser->avatarUrl = "https://archive.lainchan.jp/diy/thumb/1445879602710.png"; + + addLocalMessage(u8"[emoji](https://discordemoji.com/assets/emoji/PepeDab.gif) deaf [emoji](https://discordemoji.com/assets/emoji/COGGERS.gif)", &systemUser); + addLocalMessage(u8"[emoji](https://discordemoji.com/assets/emoji/PepeDab.gif)[emoji](https://discordemoji.com/assets/emoji/COGGERS.gif)", &systemUser); + addLocalMessage(u8"pepedab https://discordemoji.com/assets/emoji/PepeDab.gif coggers https://discordemoji.com/assets/emoji/COGGERS.gif check out this url http://www.grandtournation.com/6808/start-date-of-the-grand-tour-season-3-confirmed-mark-your-calendars/ owo", &systemUser); if(database) database->seed(databaseNodeInfo); @@ -91,6 +81,10 @@ namespace dchat void Channel::addLocalMessage(const std::string &msg, User *owner, u64 timestampSeconds) { assert(owner); + if(timestampSeconds == 0) + { + timestampSeconds = time(NULL); + } messageBoard.addMessage(new Message(owner, msg, timestampSeconds)); } -- cgit v1.2.3