Add 'replay' command to the away module #16

Merged
merged 2 commits into from May 21, 2011

2 participants

@pfn
pfn commented Mar 1, 2011

Replays to the user using PRIVMSG from the sender so that conventional IRC semantics are preserved (query windows, etc.) when rendering messages.

@psychon
znc member

Hm, could use iterators instead of operator[], but meh, the rest of away doesn't do that either.
However, it would really make sense to add new commands to the list from "help".

@psychon psychon commented on the diff Mar 1, 2011
modules/away.cpp
@@ -179,6 +179,15 @@ public:
for (u_int a = 0; a < m_vMessages.size(); a++)
PutModule(m_vMessages[a]);
}
+ else if (sCmdName == "replay")
+ {
+ CString nick = GetClient()->GetNick();
+ for (u_int a = 0; a < m_vMessages.size(); a++) {
@psychon
znc member
psychon added a note Mar 1, 2011

Since you asked on IRC:

for (VCString::const_iterator it = m_vMessages.begin(); it != m_vMessages.end(); ++it) {
    const CString& sMsg = *it;
    CString sWhom = sMsg.Token(1, false, ":");
    [...]
}

But since the rest of away doesn't use this either, there's no need to start using iterators here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@psychon
znc member

I just remembered that I wanted to pull this before I pull kylef's change to away, but it seems like I got the order wrong, sorry.
This now causes conflicts when pulled.

@psychon psychon merged commit c39ebe3 into znc:master May 21, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment