int JP_ChatboxOutgoing( void ) { char *msg = NULL; if ( currentChatbox && currentChatbox->identifier[0] ) { ENG_CBuf_AddText( va( "msgchan %s %s", currentChatbox->identifier, chatField->buffer ) ); return 1; } else if ( currentChatbox && !Q_stricmp( currentChatbox->shortname, "team" ) ) { ENG_CBuf_AddText( va( "say_team %s", chatField->buffer ) ); return 1; } if ( chatField->buffer[0] == '/' && (cg_chatboxCompletion.integer & 2) ) { ENG_CBuf_AddText( chatField->buffer+1 ); return 1; } //RAZTODO: Handle say/say_team manually for a larger message? msg = JPLua_Event_ChatMessageSent( chatField->buffer ); if ( !msg ) return 1; Q_strncpyz( chatField->buffer, msg, sizeof( chatField->buffer ) ); GetNewChatHistory( chatField->buffer ); // HandleTeamBinds( chatField->buffer, sizeof( chatField->buffer ) ); return 0; }
void CG_ChatboxOutgoing( void ) { // remove the key catcher CG_ChatboxEscape(); // commit the current line to history GetNewChatHistory( chatField.buffer ); // intercept team messages, replace teambinds like #h if ( chat_team ) { CG_HandleTeamBinds( chatField.buffer, sizeof( chatField.buffer ) ); trap->SendClientCommand( va( "say_team %s", chatField.buffer ) ); return; } // send as regular message trap->SendClientCommand( va( "say %s", chatField.buffer ) ); }