X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmsgbase.c;h=d8e7609560518340db9c87df93f66a9c8dc61378;hb=3c201b1624a4213b903757401538d74cd1d7dfa9;hp=8eba07ce4cb0ce865fb998794b8dc158c54385f9;hpb=6da0f457fc3bfdef57cf16100c83b2bc10e3b828;p=citadel.git diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 8eba07ce4..d8e760956 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -2171,12 +2171,14 @@ int CtdlDoIHavePermissionToPostInThisRoom(char *errmsgbuf) { struct recptypes *validate_recipients(char *recipients) { struct recptypes *ret; char this_recp[SIZ]; + char this_recp_cooked[SIZ]; char append[SIZ]; int num_recps; - int i; + int i, j; int mailtype; int invalid; struct usersupp tempUS; + struct quickroom tempQR; /* Initialize */ ret = (struct recptypes *) malloc(sizeof(struct recptypes)); @@ -2187,6 +2189,7 @@ struct recptypes *validate_recipients(char *recipients) { ret->num_internet = 0; ret->num_ignet = 0; ret->num_error = 0; + ret->num_room = 0; if (recipients == NULL) { num_recps = 0; @@ -2213,6 +2216,14 @@ struct recptypes *validate_recipients(char *recipients) { mailtype = alias(this_recp); mailtype = alias(this_recp); mailtype = alias(this_recp); + for (j=0; j<=strlen(this_recp); ++j) { + if (this_recp[j]=='_') { + this_recp_cooked[j] = ' '; + } + else { + this_recp_cooked[j] = this_recp[j]; + } + } invalid = 0; switch(mailtype) { case MES_LOCAL: @@ -2232,6 +2243,22 @@ struct recptypes *validate_recipients(char *recipients) { } strcat(ret->recp_local, this_recp); } + else if (getuser(&tempUS, this_recp_cooked) == 0) { + ++ret->num_local; + strcpy(this_recp, tempUS.fullname); + if (strlen(ret->recp_local) > 0) { + strcat(ret->recp_local, "|"); + } + strcat(ret->recp_local, this_recp); + } + else if ( (!strncasecmp(this_recp, "room_", 5)) + && (!getroom(&tempQR, &this_recp_cooked[5])) ) { + ++ret->num_room; + if (strlen(ret->recp_room) > 0) { + strcat(ret->recp_room, "|"); + } + strcat(ret->recp_room, &this_recp_cooked[5]); + } else { ++ret->num_error; invalid = 1;