MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / LogInputUsage

Function LogInputUsage

src/Chat.c:255–264  ·  view source on GitHub ↗

#######################################################################################################################* *-------------------------------------------------------Generic chat------------------------------------------------------* *#########################################################################################################################*/

Source from the content-addressed store, hash-verified

253*-------------------------------------------------------Generic chat------------------------------------------------------*
254*#########################################################################################################################*/
255static void LogInputUsage(const cc_string* text) {
256 /* Simplify navigating through input history by not logging duplicate entries */
257 if (Chat_InputLog.count) {
258 int lastIndex = Chat_InputLog.count - 1;
259 cc_string last = StringsBuffer_UNSAFE_Get(&Chat_InputLog, lastIndex);
260
261 if (String_Equals(text, &last)) return;
262 }
263 StringsBuffer_Add(&Chat_InputLog, text);
264}
265
266void Chat_Send(const cc_string* text, cc_bool logUsage) {
267 if (!text->length) return;

Callers 1

Chat_SendFunction · 0.85

Calls 3

StringsBuffer_UNSAFE_GetFunction · 0.85
String_EqualsFunction · 0.85
StringsBuffer_AddFunction · 0.85

Tested by

no test coverage detected