timestamps
This commit is contained in:
parent
59a94d337f
commit
333be4f6ab
|
@ -1 +1 @@
|
|||
{"categories":[{"name":"to do","content":[{"name":"ability to change token","description":"use a config file to store token so that \n\n1- it is away from github\n\n2- it is configurable if need be","id":1},{"name":"clean up bot code","description":"try to remove unnecessary code\n\nunindent\n\ngive sender to function ?","id":2},{"name":"trayable ?","description":"// Hello there","id":5},{"name":"guild unread ?","description":"// Hello there","id":2},{"name":"new message marker","description":"perma if too complicated to detect read","id":2},{"name":"proper links","description":"when there is a link, ability to click it","id":3}]},{"name":"in progress","content":[]},{"name":"done","content":[{"name":"run discord bot","description":"make it so the bot is running","id":1},{"name":"fixed token in github","description":"// Hello there","id":1},{"name":"fetch previous messages","description":"// Hello there","id":4},{"name":"ability to write messages","description":"// Hello there","id":5},{"name":"get incoming messages","description":"read","id":2},{"name":"unread system","description":"add a * when a channel just received a message","id":1},{"name":"remember channel id for dm","description":"and put in config file\n\nmaybe load message ? dm first ?","id":3}]},{"name":"bugs","content":[]},{"name":"v1.0","content":[{"name":"better ui error display","description":"handle the error packet for better display","id":1},{"name":"notifications !!!","description":"// Hello there","id":4},{"name":"timestamps","description":"// Hello there","id":1},{"name":"bug : does not save notification state for dm","description":"// Hello there","id":1},{"name":"handle unknown channel better","description":"when receiving a message from a not yet scanned guild, create the channel and put the message\n\nallow scanning if guild selected\n\ndo not add duplicate channel","id":1}]},{"name":"+","content":[]}]}
|
||||
{"categories":[{"name":"to do","content":[{"name":"ability to change token","description":"use a config file to store token so that \n\n1- it is away from github\n\n2- it is configurable if need be","id":1},{"name":"clean up bot code","description":"try to remove unnecessary code\n\nunindent\n\ngive sender to function ?","id":2},{"name":"trayable ?","description":"// Hello there","id":5},{"name":"new message marker","description":"perma if too complicated to detect read","id":2},{"name":"proper links","description":"when there is a link, ability to click it","id":3}]},{"name":"in progress","content":[]},{"name":"done","content":[{"name":"run discord bot","description":"make it so the bot is running","id":1},{"name":"fixed token in github","description":"// Hello there","id":1},{"name":"fetch previous messages","description":"// Hello there","id":4},{"name":"ability to write messages","description":"// Hello there","id":5},{"name":"get incoming messages","description":"read","id":2},{"name":"unread system","description":"add a * when a channel just received a message","id":1},{"name":"remember channel id for dm","description":"and put in config file\n\nmaybe load message ? dm first ?","id":3},{"name":"bug : does not save notification state for dm","description":"// Hello there","id":1},{"name":"handle unknown channel better","description":"when receiving a message from a not yet scanned guild, create the channel and put the message\n\nallow scanning if guild selected\n\ndo not add duplicate channel","id":1},{"name":"guild unread ?","description":"// Hello there","id":2}]},{"name":"bugs","content":[]},{"name":"v1.0","content":[{"name":"better ui error display","description":"handle the error packet for better display","id":1},{"name":"notifications !!!","description":"// Hello there","id":4},{"name":"timestamps","description":"// Hello there","id":1}]},{"name":"+","content":[]}]}
|
|
@ -1,4 +1,5 @@
|
|||
use eframe::egui;
|
||||
use chrono::DateTime;
|
||||
|
||||
use crate::postman;
|
||||
use crate::Jiji;
|
||||
|
@ -74,6 +75,7 @@ impl Jiji {
|
|||
if ui.add(egui::SelectableLabel::new(self.selected_channel == None, "None")).clicked() {
|
||||
if let Some(selected_channel_index) = &self.selected_channel {
|
||||
self.guilds[*selected_guild_index].channels[*selected_channel_index].unread = false;
|
||||
self.guilds[*selected_guild_index].check_unread();
|
||||
}
|
||||
self.selected_channel = None;
|
||||
}
|
||||
|
@ -173,7 +175,12 @@ impl Jiji {
|
|||
}
|
||||
if message.author_name != last_author {
|
||||
ui.separator();
|
||||
ui.horizontal( |ui| {
|
||||
ui.colored_label(hex_str_to_color("#3399ff"), &message.author_name);
|
||||
if let Ok(timestamp) = DateTime::parse_from_rfc2822(&message.timestamp) {
|
||||
ui.label(timestamp.format("%H:%M (%a, %e %b)").to_string());
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ui.label("");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue