| 125 | } |
| 126 | |
| 127 | void ChannelViewOld::UpdateAcknowledgement(Snowflake sf) |
| 128 | { |
| 129 | for (size_t i = 0; i < m_items.size(); i++) |
| 130 | { |
| 131 | auto& item = m_items[i]; |
| 132 | if (item.m_id != sf) |
| 133 | continue; |
| 134 | |
| 135 | Channel* pChan = GetDiscordInstance()->GetChannel(sf); |
| 136 | if (!pChan) { |
| 137 | DbgPrintW("ERROR: No channel"); |
| 138 | break; |
| 139 | } |
| 140 | |
| 141 | LPTSTR tstr = ConvertCppStringToTString(GetChannelString(*pChan)); |
| 142 | // but why can't I just set the string's data? |
| 143 | int oldsel = ListBox_GetCurSel(m_listHwnd); |
| 144 | ListBox_DeleteString(m_listHwnd, i); |
| 145 | ListBox_InsertString(m_listHwnd, i, tstr); |
| 146 | ListBox_SetCurSel(m_listHwnd, oldsel); |
| 147 | free(tstr); |
| 148 | break; |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | void ChannelViewOld::AddChannel(const Channel& ch) |
| 153 | { |
nothing calls this directly
no test coverage detected