MCPcopy Create free account
hub / github.com/DiscordMessenger/dm / AddChannel

Method AddChannel

src/windows/ChannelViewOld.cpp:152–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152void ChannelViewOld::AddChannel(const Channel& ch)
153{
154 if (!ch.HasPermissionConst(PERM_VIEW_CHANNEL))
155 {
156 // If not a category, return. We'll remove invisible categories without elements after the fact.
157 if (ch.m_channelType != Channel::CATEGORY)
158 return;
159 }
160
161 // TODO: Implement category order sorting. For now, they're sorted by ID.
162 // 11/06/2025 - Are they!?
163 int categIndex = ch.IsCategory() ? ch.m_pos : 0;
164
165 m_idToIdx[ch.m_snowflake] = (int) m_items.size();
166 m_items.push_back({ ch.m_parentCateg, ch.m_snowflake, ch.m_channelType, GetChannelString(ch), categIndex, ch.m_pos, ch.m_lastSentMsg });
167}
168
169void ChannelViewOld::RemoveCategoryIfNeeded(const Channel& ch)
170{

Callers

nothing calls this directly

Calls 4

GetChannelStringFunction · 0.85
HasPermissionConstMethod · 0.80
IsCategoryMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected