refactor status message
This commit is contained in:
parent
7710da6c89
commit
e8b069c803
@ -88,9 +88,24 @@ namespace Contact::Components {
|
||||
} state = disconnected;
|
||||
};
|
||||
|
||||
// status message
|
||||
struct StatusMessage {
|
||||
std::string msg;
|
||||
struct StatusText {
|
||||
// aka status message
|
||||
std::string text;
|
||||
|
||||
// how much of the beginning of the text is the first line
|
||||
size_t first_line_length {0u};
|
||||
|
||||
void fillFirstLineLength(void) {
|
||||
first_line_length = 0u;
|
||||
// find end of line
|
||||
for (const auto c : text) {
|
||||
if (c == '\n' || c == '\0') {
|
||||
break;
|
||||
}
|
||||
|
||||
first_line_length++;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// last seen (not disconnected?)
|
||||
|
@ -36,7 +36,7 @@ DEFINE_COMP_ID(Contact::Components::TagAvatarInvalidate)
|
||||
DEFINE_COMP_ID(Contact::Components::AvatarMemory)
|
||||
DEFINE_COMP_ID(Contact::Components::AvatarFile)
|
||||
DEFINE_COMP_ID(Contact::Components::ConnectionState)
|
||||
DEFINE_COMP_ID(Contact::Components::StatusMessage)
|
||||
DEFINE_COMP_ID(Contact::Components::StatusText)
|
||||
|
||||
#undef DEFINE_COMP_ID
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user