MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / parseSource

Function parseSource

plugins/twitch/chat-connection.cpp:137–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137static void parseSource(const std::string &rawSourceComponent,
138 IRCMessage &message)
139{
140 if (rawSourceComponent.empty()) {
141 return;
142 }
143 size_t nickPos = 0;
144 size_t nickEndPos = rawSourceComponent.find('!');
145
146 if (nickEndPos != std::string::npos) {
147 message.source.nick = rawSourceComponent.substr(
148 nickPos, nickEndPos - nickPos);
149 message.source.host = rawSourceComponent.substr(nickEndPos + 1);
150 } else {
151 // Assume the entire source is the host if no '!' is found
152 message.source.host = rawSourceComponent;
153 }
154}
155
156static void parseCommand(const std::string &rawCommandComponent,
157 IRCMessage &message)

Callers 1

parseMessageFunction · 0.85

Calls 3

findMethod · 0.80
substrMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected