2 files changed, 7 insertions, 2 deletions
diff --git a/include/Utils.h b/include/Utils.h
index 183ebbbe..bbe46dd8 100644
--- a/include/Utils.h
+++ b/include/Utils.h
@@ -17,4 +17,9 @@ descriptiveTime(const QDateTime &then);
//! in the RoomList.
DescInfo
getMessageDescription(const TimelineEvent &event, const QString &localUser);
+
+//! Get the first character of a string, taking into account that
+//! surrogate pairs might be in use.
+QString
+firstChar(const QString &input);
}
diff --git a/include/ui/Avatar.h b/include/ui/Avatar.h
index dc089139..d856b9d8 100644
--- a/include/ui/Avatar.h
+++ b/include/ui/Avatar.h
@@ -21,7 +21,7 @@ public:
void setBackgroundColor(const QColor &color);
void setIcon(const QIcon &icon);
void setImage(const QImage &image);
- void setLetter(const QChar &letter);
+ void setLetter(const QString &letter);
void setSize(int size);
void setTextColor(const QColor &color);
@@ -38,7 +38,7 @@ private:
void init();
ui::AvatarType type_;
- QChar letter_;
+ QString letter_;
QColor background_color_;
QColor text_color_;
QIcon icon_;
|