summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes.lang4
-rw-r--r--lang/en_us.l4
-rw-r--r--memoserv.c90
-rw-r--r--version.log6
4 files changed, 29 insertions, 75 deletions
diff --git a/Changes.lang b/Changes.lang
index 2c32c1d40..9c289adbb 100644
--- a/Changes.lang
+++ b/Changes.lang
@@ -8,6 +8,10 @@ MEMO_RSEND_SYNTAX
MEMO_RSEND_NICK_MEMO_TEXT
MEMO_RSEND_CHAN_MEMO_TEXT
MEMO_RSEND_USER_NOTIFICATION
+MEMO_HELP_RSEND
+
+*** Mod Strings:
+MEMO_HELP
Anope Version 1.7.2
--------------------
diff --git a/lang/en_us.l b/lang/en_us.l
index fa3348597..11021b7a2 100644
--- a/lang/en_us.l
+++ b/lang/en_us.l
@@ -1719,9 +1719,9 @@ MEMO_RSEND_DISABLED
MEMO_RSEND_SYNTAX
RSEND {nick | channel} memo-text
MEMO_RSEND_NICK_MEMO_TEXT
- Your memo sent to %s has been read.
+ [auto-memo] The memo you sent has been viewed.
MEMO_RSEND_CHAN_MEMO_TEXT
- Your memo sent to %s has been read by %s.
+ [auto-memo] The memo you sent to %s has been viewed.
MEMO_RSEND_USER_NOTIFICATION
A notification memo has been sent to %s informing him/her you have
read his/her memo.
diff --git a/memoserv.c b/memoserv.c
index 587b65a59..ec7ec6599 100644
--- a/memoserv.c
+++ b/memoserv.c
@@ -1264,99 +1264,45 @@ static int do_rsend(User * u)
void rsend_notify(User *u, Memo *m, const char *chan)
{
- User *nu;
- Memo *nm;
- MemoInfo *nmi;
- NickAlias *nna;
- NickCore *nnc;
+ NickAlias *na;
+ NickCore *nc;
char text[256];
const char *fmt;
- int i;
/* Only send receipt if memos are allowed */
if ((!readonly) && (!checkDefCon(DEFCON_NO_NEW_MEMOS))) {
- /* Gather nick alias, nick core and memo info for sender */
- nna = findnick(m->sender);
- nnc = nna->nc;
- nmi = &nnc->memos;
-
- /* Increase the sender's memocount by one */
- nmi->memocount++;
-
- /* Allocate memory for the new memo */
- nmi->memos = srealloc(nmi->memos,
- sizeof(Memo) * nmi->memocount);
-
- /* Grab the new memo pointer to work on it */
- nm = &nmi->memos[nmi->memocount - 1];
+ /* Get nick alias for sender */
+ na = findnick(m->sender);
- /* Sender is MemoServ */
- strscpy(nm->sender, s_MemoServ, NICKMAX);
+ if (!na) {
+ return;
+ }
- /* If the user has more than one memo, assign the new
- memo the next available index */
- if (nmi->memocount > 1) {
- nm->number = nm[-1].number + 1;
+ /* Get nick core for sender */
+ nc = na->nc;
- /* If needed, reindex memos */
- if (nm->number < 1) {
- for (i = 0; i < nmi->memocount; i++) {
- nmi->memos[i].number = i + 1;
- }
- }
- } else {
- /* User has no memos. Use index 1 */
- nm->number = 1;
+ if (!nc) {
+ return;
}
- /* Populate memo structure and set text */
- nm->time = time(NULL);
-
/* Text of the memo varies if the recepient was a
nick or channel */
if (chan) {
- fmt = getstring(nna, MEMO_RSEND_CHAN_MEMO_TEXT);
- sprintf(text, fmt, chan, u->na->nc->display);
+ fmt = getstring(na, MEMO_RSEND_CHAN_MEMO_TEXT);
+ sprintf(text, fmt, chan);
} else {
- fmt = getstring(nna, MEMO_RSEND_NICK_MEMO_TEXT);
- sprintf(text, fmt, u->na->nc->display);
+ fmt = getstring(na, MEMO_RSEND_NICK_MEMO_TEXT);
+ sprintf(text, fmt);
}
- nm->text = sstrdup(text);
- nm->flags = MF_UNREAD;
+ /* Send notification */
+ memo_send(u, m->sender, text, 0);
/* Notify recepient of the memo that a notification has
been sent to the sender */
notice_lang(s_MemoServ, u, MEMO_RSEND_USER_NOTIFICATION,
- nnc->display);
-
- /* Check to see if we're notifying all aliases in the sender's
- group or just the sender */
- if (MSNotifyAll) {
- if ((nnc->flags & NI_MEMO_RECEIVE) &&
- get_ignore(m->sender) == NULL) {
- for (i = 0; i < nnc->aliases.count; i++) {
- nna = nnc->aliases.list[i];
- if (nna->u && nick_identified(nna->u)) {
- notice_lang(s_MemoServ, nna->u,
- MEMO_NEW_MEMO_ARRIVED,
- s_MemoServ, s_MemoServ,
- nm->number);
- }
- }
- } else {
- /* Find the sender user via the display nick */
- nu = finduser(nnc->display);
-
- if (nick_identified(nu)) {
- notice_lang(s_MemoServ, u,
- MEMO_NEW_MEMO_ARRIVED,
- s_MemoServ, s_MemoServ,
- nm->number);
- }
- }
- }
+ nc->display);
}
/* Remove receipt flag from the original memo */
diff --git a/version.log b/version.log
index 13d9ef4d4..08fb26913 100644
--- a/version.log
+++ b/version.log
@@ -8,11 +8,15 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="2"
-VERSION_BUILD="69"
+VERSION_BUILD="70"
VERSION_EXTRA=""
# $Log$
#
+# BUILD : 1.7.2 (70)
+# BUGS :
+# NOTES : Modified RSEND to send receipt memo as user instead of MemoServ
+#
# BUILD : 1.7.2 (69)
# BUGS :
# NOTES : Added new MemoServ command RSEND to send a memo requesting a receipt memo once the recipient reads it.