Skip to content

Commit

Permalink
Miscellaneous cmd fixes : PRIVMSG, PING/PONG, server commands (#25)
Browse files Browse the repository at this point in the history
* fix: fixing privmsg to be more compliant with ngirc behavior

* fix: additionnal privmsg fixes

* fix: killing client connection with an error message if message > 512 chars

* fix: missing return on catch

* fix: ping timeout from the server now sends error message to the client before killing it

* fix: set ping time when a user is pinged to allow calculation of pong timeout

* fix: review of privmsg to send blocking err message when it is needed and non blocking when it should

* fix: correct try / catch position

* fix: no such nick on nickname with no name

* fix: code error on checking find return

* fix: completing possible user formats

* fix: error formatting user and nicknames

* fix: better exceptions

* fix: added : in front of every message

* fix: typo in repies

* fix: removing grammar check to let a wrong nick / user / host / server send an error reply

* git: updated gitignore

* fix: removing unused libraries from server.cpp
  • Loading branch information
twagger authored Aug 4, 2022
1 parent 56f537a commit aa71bc6
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 191 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
## Other
.DS_Store
ircserv
helper

# Debug files
*.dSYM/
Expand Down
6 changes: 3 additions & 3 deletions includes/replies.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@

//ADDITIONAL CLIENT REPLIES
#define PING(origin) ("PING " + origin + "\r\n")
#define PONG(origin) ("PONG " + origin + "\r\n")
#define PRIVMSG(target, message) ("PRIVMSG " + target + " " + message)
//#define CLIENT_NICK(prefix, nickname) (prefix + " " + nickname + "\r\n")
#define PONG(origin) (":" + origin + " PONG " + origin + "\r\n")
#define PRIVMSG(target, message) ("PRIVMSG " + target + " :" + message)
#define CLIENT_QUIT(prefix, msg) (prefix + " " + msg + "\r\n")
#define CLIENT_ERROR ("ERROR : \r\n")
#define CLIENT_ERRORMSG(msg) ("ERROR :\"" + msg + "\"\r\n")
#define ERRORMSG(msg) ("ERROR : :" + msg + "\r\n")

#endif
Loading

0 comments on commit aa71bc6

Please sign in to comment.