Skip to content

Commit

Permalink
chat and contact dialogs to honor emoji_enabled setting
Browse files Browse the repository at this point in the history
  • Loading branch information
d99kris committed Jan 5, 2025
1 parent c0f48b0 commit 3de1246
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/common/src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

#pragma once

#define NCHAT_VERSION "5.5.4"
#define NCHAT_VERSION "5.5.5"
2 changes: 1 addition & 1 deletion src/nchat.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man.
.TH NCHAT "1" "January 2025" "nchat 5.5.4" "User Commands"
.TH NCHAT "1" "January 2025" "nchat 5.5.5" "User Commands"
.SH NAME
nchat \- ncurses chat
.SH SYNOPSIS
Expand Down
9 changes: 8 additions & 1 deletion src/uichatlistdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// uichatlistdialog.cpp
//
// Copyright (c) 2024 Kristofer Berggren
// Copyright (c) 2024-2025 Kristofer Berggren
// All rights reserved.
//
// nchat is distributed under the MIT license, see LICENSE for details.
Expand Down Expand Up @@ -51,6 +51,8 @@ bool UiChatListDialog::OnTimer()

void UiChatListDialog::UpdateList()
{
const bool emojiEnabled = m_Model->GetEmojiEnabled();

m_Index = 0;
m_Items.clear();
m_ChatListItemVec.clear();
Expand All @@ -73,6 +75,11 @@ void UiChatListDialog::UpdateList()
std::string displayName = name +
(isMultipleProfiles ? " @ " + m_Model->GetProfileDisplayName(profileId) : "");

if (!emojiEnabled)
{
displayName = StrUtil::Textize(displayName);
}

static const bool developerMode = AppUtil::GetDeveloperMode();
if (developerMode)
{
Expand Down
9 changes: 8 additions & 1 deletion src/uicontactlistdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// uicontactlistdialog.cpp
//
// Copyright (c) 2019-2024 Kristofer Berggren
// Copyright (c) 2019-2025 Kristofer Berggren
// All rights reserved.
//
// nchat is distributed under the MIT license, see LICENSE for details.
Expand Down Expand Up @@ -70,6 +70,8 @@ void UiContactListDialog::UpdateList()
m_DialogContactInfos = m_Model->GetContactInfos();
}

const bool emojiEnabled = m_Model->GetEmojiEnabled();

m_Index = 0;
m_Items.clear();
m_ContactListItemVec.clear();
Expand All @@ -94,6 +96,11 @@ void UiContactListDialog::UpdateList()
std::string displayName = name +
(isMultipleProfiles ? " @ " + m_Model->GetProfileDisplayName(profileId) : "");

if (!emojiEnabled)
{
displayName = StrUtil::Textize(displayName);
}

static const bool developerMode = AppUtil::GetDeveloperMode();
if (developerMode)
{
Expand Down

0 comments on commit 3de1246

Please sign in to comment.