projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c61307c
)
And a few more things comply with the coding style.
author
Dave West
<davew@uncensored.citadel.org>
Sun, 25 Oct 2009 01:07:14 +0000
(
01:07
+0000)
committer
Dave West
<davew@uncensored.citadel.org>
Sun, 25 Oct 2009 01:07:14 +0000
(
01:07
+0000)
16 files changed:
citadel/include/ctdl_module.h
patch
|
blob
|
history
citadel/modules/calendar/serv_calendar.c
patch
|
blob
|
history
citadel/modules/expire/serv_expire.c
patch
|
blob
|
history
citadel/modules/extnotify/extnotify_main.c
patch
|
blob
|
history
citadel/modules/imap/serv_imap.c
patch
|
blob
|
history
citadel/modules/migrate/serv_migrate.c
patch
|
blob
|
history
citadel/modules/newuser/serv_newuser.c
patch
|
blob
|
history
citadel/modules/openid/serv_openid_rp.c
patch
|
blob
|
history
citadel/modules/pas2/serv_pas2.c
patch
|
blob
|
history
citadel/modules/pop3/serv_pop3.c
patch
|
blob
|
history
citadel/modules/upgrade/serv_upgrade.c
patch
|
blob
|
history
citadel/modules/vcard/serv_vcard.c
patch
|
blob
|
history
citadel/msgbase.c
patch
|
blob
|
history
citadel/room_ops.c
patch
|
blob
|
history
citadel/user_ops.c
patch
|
blob
|
history
citadel/user_ops.h
patch
|
blob
|
history
diff --git
a/citadel/include/ctdl_module.h
b/citadel/include/ctdl_module.h
index c0e24b637370d4ae666d379ad5edc485c96f79a7..9c66304a58dfcc648a537f7620a20e037538976f 100644
(file)
--- a/
citadel/include/ctdl_module.h
+++ b/
citadel/include/ctdl_module.h
@@
-27,6
+27,9
@@
#include <sys/wait.h>
#include <string.h>
#include <sys/wait.h>
#include <string.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
#include <limits.h>
#include <limits.h>
@@
-280,6
+283,13
@@
int CtdlGetUserLock(struct ctdluser *usbuf, char *name);
void CtdlPutUser(struct ctdluser *usbuf);
void CtdlPutUserLock(struct ctdluser *usbuf);
int CtdlGetUserByNumber(struct ctdluser *usbuf, long number);
void CtdlPutUser(struct ctdluser *usbuf);
void CtdlPutUserLock(struct ctdluser *usbuf);
int CtdlGetUserByNumber(struct ctdluser *usbuf, long number);
+void CtdlGetRelationship(struct visit *vbuf,
+ struct ctdluser *rel_user,
+ struct ctdlroom *rel_room);
+void CtdlSetRelationship(struct visit *newvisit,
+ struct ctdluser *rel_user,
+ struct ctdlroom *rel_room);
+void CtdlMailboxName(char *buf, size_t n, const struct ctdluser *who, const char *prefix);
#endif /* CTDL_MODULE_H */
#endif /* CTDL_MODULE_H */
diff --git
a/citadel/modules/calendar/serv_calendar.c
b/citadel/modules/calendar/serv_calendar.c
index 2e7dc422e72c99abab054b08c2c13fef72044fe5..0426814af7c42619bbbbb9a4b4de5d63354e9af0 100644
(file)
--- a/
citadel/modules/calendar/serv_calendar.c
+++ b/
citadel/modules/calendar/serv_calendar.c
@@
-25,29
+25,14
@@
#define PRODID "-//Citadel//NONSGML Citadel Calendar//EN"
#define PRODID "-//Citadel//NONSGML Citadel Calendar//EN"
-#include "sysdep.h"
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <limits.h>
-#include <stdio.h>
-#include <string.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
+#include "ctdl_module.h"
+
#include <libical/ical.h>
#include <libical/ical.h>
-#include <libcitadel.h>
-#include "citadel.h"
-#include "server.h"
-#include "citserver.h"
-#include "support.h"
-#include "config.h"
-#include "user_ops.h"
+
#include "msgbase.h"
#include "internet_addressing.h"
#include "serv_calendar.h"
#include "euidindex.h"
#include "msgbase.h"
#include "internet_addressing.h"
#include "serv_calendar.h"
#include "euidindex.h"
-#include "ctdl_module.h"
#include "ical_dezonify.h"
#include "ical_dezonify.h"
@@
-670,7
+655,7
@@
int ical_update_my_calendar_with_reply(icalcomponent *cal) {
icalcomponent_free(original_event); /* Don't need this anymore. */
if (serialized_event == NULL) return(2);
icalcomponent_free(original_event); /* Don't need this anymore. */
if (serialized_event == NULL) return(2);
- MailboxName(roomname, sizeof roomname, &CC->user, USERCALENDARROOM);
+
Ctdl
MailboxName(roomname, sizeof roomname, &CC->user, USERCALENDARROOM);
message_text = malloc(strlen(serialized_event) + SIZ);
if (message_text != NULL) {
message_text = malloc(strlen(serialized_event) + SIZ);
if (message_text != NULL) {
@@
-1501,7
+1486,7
@@
void ical_freebusy(char *who) {
return;
}
return;
}
- MailboxName(calendar_room_name, sizeof calendar_room_name,
+
Ctdl
MailboxName(calendar_room_name, sizeof calendar_room_name,
&usbuf, USERCALENDARROOM);
strcpy(hold_rm, CC->room.QRname); /* save current room */
&usbuf, USERCALENDARROOM);
strcpy(hold_rm, CC->room.QRname); /* save current room */
@@
-2473,7
+2458,7
@@
int ical_obj_aftersave(struct CtdlMessage *msg)
*/
/* First determine if this is our room */
*/
/* First determine if this is our room */
- MailboxName(roomname, sizeof roomname, &CC->user, USERCALENDARROOM);
+
Ctdl
MailboxName(roomname, sizeof roomname, &CC->user, USERCALENDARROOM);
if (strcasecmp(roomname, CC->room.QRname)) {
return(0); /* Not the Calendar room -- don't do anything. */
}
if (strcasecmp(roomname, CC->room.QRname)) {
return(0); /* Not the Calendar room -- don't do anything. */
}
diff --git
a/citadel/modules/expire/serv_expire.c
b/citadel/modules/expire/serv_expire.c
index 555a6b3c037ddbc96d25c437a81f16bcd0b14f9b..b0824e2fb23fea28011c13e7803b028421b400f5 100644
(file)
--- a/
citadel/modules/expire/serv_expire.c
+++ b/
citadel/modules/expire/serv_expire.c
@@
-829,7
+829,7
@@
int PurgeStaleOpenIDassociations(void) {
while (cdboi = cdb_next_item(CDB_OPENID), cdboi != NULL) {
if (cdboi->len > sizeof(long)) {
memcpy(&usernum, cdboi->ptr, sizeof(long));
while (cdboi = cdb_next_item(CDB_OPENID), cdboi != NULL) {
if (cdboi->len > sizeof(long)) {
memcpy(&usernum, cdboi->ptr, sizeof(long));
- if (
getuserbyn
umber(&usbuf, usernum) != 0) {
+ if (
CtdlGetUserByN
umber(&usbuf, usernum) != 0) {
deleteme = strdup(cdboi->ptr + sizeof(long)),
Put(keys, deleteme, strlen(deleteme), deleteme, generic_free_handler);
}
deleteme = strdup(cdboi->ptr + sizeof(long)),
Put(keys, deleteme, strlen(deleteme), deleteme, generic_free_handler);
}
diff --git
a/citadel/modules/extnotify/extnotify_main.c
b/citadel/modules/extnotify/extnotify_main.c
index 3255f4b16a5730689b6c3bea1b5cb3d170152de6..2b2cdc6482263115af3fb50f1115b82894a3ca16 100644
(file)
--- a/
citadel/modules/extnotify/extnotify_main.c
+++ b/
citadel/modules/extnotify/extnotify_main.c
@@
-367,7
+367,7
@@
long extNotify_getConfigMessage(char *username) {
// Get the user
CtdlGetUser(&user, username);
// Get the user
CtdlGetUser(&user, username);
- MailboxName(configRoomName, sizeof configRoomName, &user, USERCONFIGROOM);
+
Ctdl
MailboxName(configRoomName, sizeof configRoomName, &user, USERCONFIGROOM);
// Fill qrbuf
CtdlGetRoom(&qrbuf, configRoomName);
/* Do something really, really stoopid here. Raid the room on ourselves,
// Fill qrbuf
CtdlGetRoom(&qrbuf, configRoomName);
/* Do something really, really stoopid here. Raid the room on ourselves,
diff --git
a/citadel/modules/imap/serv_imap.c
b/citadel/modules/imap/serv_imap.c
index 1322bc45389664f8d0f920b7633becd9bc1d1d0e..e7e9ad901f0c00c5b5d05597464bd2f92829cb99 100644
(file)
--- a/
citadel/modules/imap/serv_imap.c
+++ b/
citadel/modules/imap/serv_imap.c
@@
-720,7
+720,7
@@
void imap_select(int num_parms, char *parms[])
/* Then try a mailbox name match */
if (c != 0) {
/* Then try a mailbox name match */
if (c != 0) {
- MailboxName(augmented_roomname, sizeof augmented_roomname,
+
Ctdl
MailboxName(augmented_roomname, sizeof augmented_roomname,
&CC->user, towhere);
c = CtdlGetRoom(&QRscratch, augmented_roomname);
if (c == 0)
&CC->user, towhere);
c = CtdlGetRoom(&QRscratch, augmented_roomname);
if (c == 0)
@@
-1000,7
+1000,7
@@
int imap_grabroom(char *returned_roomname, char *foldername, int zapped_ok)
/* Then try a mailbox name match */
if (c != 0) {
/* Then try a mailbox name match */
if (c != 0) {
- MailboxName(augmented_roomname, sizeof augmented_roomname,
+
Ctdl
MailboxName(augmented_roomname, sizeof augmented_roomname,
&CC->user, roomname);
c = CtdlGetRoom(&QRscratch, augmented_roomname);
if (c == 0)
&CC->user, roomname);
c = CtdlGetRoom(&QRscratch, augmented_roomname);
if (c == 0)
diff --git
a/citadel/modules/migrate/serv_migrate.c
b/citadel/modules/migrate/serv_migrate.c
index 7f855c5db7150ed1ae71622aeb958fc22b62fbd0..cf3395d509e7331bd5347fe722ae2b8bb00e73bb 100644
(file)
--- a/
citadel/modules/migrate/serv_migrate.c
+++ b/
citadel/modules/migrate/serv_migrate.c
@@
-719,7
+719,7
@@
void migr_xml_end(void *data, const char *el, const char **attr) {
else if (!strcasecmp(el, "u_fullname")) safestrncpy(usbuf.fullname, migr_chardata, sizeof usbuf.fullname);
else if (!strcasecmp(el, "user")) {
else if (!strcasecmp(el, "u_fullname")) safestrncpy(usbuf.fullname, migr_chardata, sizeof usbuf.fullname);
else if (!strcasecmp(el, "user")) {
-
putu
ser(&usbuf);
+
CtdlPutU
ser(&usbuf);
CtdlLogPrintf(CTDL_INFO, "Imported user: %s\n", usbuf.fullname);
}
CtdlLogPrintf(CTDL_INFO, "Imported user: %s\n", usbuf.fullname);
}
diff --git
a/citadel/modules/newuser/serv_newuser.c
b/citadel/modules/newuser/serv_newuser.c
index dae9c40cfa89925cbe92bad3d0989a990f6c0b98..08cf48d7e5fd47ae3d049d001070b08a933bd85d 100644
(file)
--- a/
citadel/modules/newuser/serv_newuser.c
+++ b/
citadel/modules/newuser/serv_newuser.c
@@
-83,7
+83,7
@@
void CopyNewUserGreetings(void) {
if (CC->user.timescalled != 1) return;
/* This user's mailbox. */
if (CC->user.timescalled != 1) return;
/* This user's mailbox. */
- MailboxName(mailboxname, sizeof mailboxname, &CC->user, MAILROOM);
+
Ctdl
MailboxName(mailboxname, sizeof mailboxname, &CC->user, MAILROOM);
/* Go to the source room ... bail out silently if it's not there,
* or if it's not private.
/* Go to the source room ... bail out silently if it's not there,
* or if it's not private.
diff --git
a/citadel/modules/openid/serv_openid_rp.c
b/citadel/modules/openid/serv_openid_rp.c
index a1996fb20b8926d359a3cb9bc6ca50770719846e..955d823c555132a98480b04858de60ea572a28a0 100644
(file)
--- a/
citadel/modules/openid/serv_openid_rp.c
+++ b/
citadel/modules/openid/serv_openid_rp.c
@@
-219,7
+219,7
@@
void cmd_oida(char *argbuf) {
while (cdboi = cdb_next_item(CDB_OPENID), cdboi != NULL) {
if (cdboi->len > sizeof(long)) {
memcpy(&usernum, cdboi->ptr, sizeof(long));
while (cdboi = cdb_next_item(CDB_OPENID), cdboi != NULL) {
if (cdboi->len > sizeof(long)) {
memcpy(&usernum, cdboi->ptr, sizeof(long));
- if (
getuserbyn
umber(&usbuf, usernum) != 0) {
+ if (
CtdlGetUserByN
umber(&usbuf, usernum) != 0) {
usbuf.fullname[0] = 0;
}
cprintf("%s|%ld|%s\n",
usbuf.fullname[0] = 0;
}
cprintf("%s|%ld|%s\n",
@@
-404,7
+404,7
@@
int openid_create_user_via_sreg(char *claimed_id, HashList *sreg_keys)
CtdlLogPrintf(CTDL_DEBUG, "The desired account name is <%s>\n", desired_name);
CtdlLogPrintf(CTDL_DEBUG, "The desired account name is <%s>\n", desired_name);
- if (!
getu
ser(&CC->user, desired_name)) {
+ if (!
CtdlGetU
ser(&CC->user, desired_name)) {
CtdlLogPrintf(CTDL_DEBUG, "<%s> is already taken by another user.\n", desired_name);
memset(&CC->user, 0, sizeof(struct ctdluser));
return(5);
CtdlLogPrintf(CTDL_DEBUG, "<%s> is already taken by another user.\n", desired_name);
memset(&CC->user, 0, sizeof(struct ctdluser));
return(5);
@@
-438,7
+438,7
@@
int login_via_openid(char *claimed_id)
memcpy(&usernum, cdboi->ptr, sizeof(long));
cdb_free(cdboi);
memcpy(&usernum, cdboi->ptr, sizeof(long));
cdb_free(cdboi);
- if (!
getuserbyn
umber(&CC->user, usernum)) {
+ if (!
CtdlGetUserByN
umber(&CC->user, usernum)) {
/* Now become the user we just created */
safestrncpy(CC->curr_user, CC->user.fullname, sizeof CC->curr_user);
do_login();
/* Now become the user we just created */
safestrncpy(CC->curr_user, CC->user.fullname, sizeof CC->curr_user);
do_login();
diff --git
a/citadel/modules/pas2/serv_pas2.c
b/citadel/modules/pas2/serv_pas2.c
index c6bb35b3dcfa8ec4b615c33fe20a64044243ffee..bb79dbdae0f3c1f167dc729122ce618d59e73862 100644
(file)
--- a/
citadel/modules/pas2/serv_pas2.c
+++ b/
citadel/modules/pas2/serv_pas2.c
@@
-69,7
+69,7
@@
void cmd_pas2(char *argbuf)
extract_token(pw, argbuf, 0, '|', sizeof pw);
extract_token(pw, argbuf, 0, '|', sizeof pw);
- if (
getu
ser(&CC->user, CC->curr_user))
+ if (
CtdlGetU
ser(&CC->user, CC->curr_user))
{
cprintf("%d Unable to find user record for %s.\n", ERROR + NO_SUCH_USER, CC->curr_user);
return;
{
cprintf("%d Unable to find user record for %s.\n", ERROR + NO_SUCH_USER, CC->curr_user);
return;
diff --git
a/citadel/modules/pop3/serv_pop3.c
b/citadel/modules/pop3/serv_pop3.c
index c0db0ea86f22f37c86895aa518851914bedeceed..612b1db98c369e67a6ed854e31e23cf6ad0b6060 100644
(file)
--- a/
citadel/modules/pop3/serv_pop3.c
+++ b/
citadel/modules/pop3/serv_pop3.c
@@
-265,7
+265,7
@@
void pop3_apop(char *argbuf)
return;
}
return;
}
- if (
getu
ser(&CC->user, CC->curr_user))
+ if (
CtdlGetU
ser(&CC->user, CC->curr_user))
{
cprintf("-ERR No such user.\r\n");
return;
{
cprintf("-ERR No such user.\r\n");
return;
@@
-504,14
+504,14
@@
void pop3_update(void) {
/* Set last read pointer */
if (POP3->num_msgs > 0) {
/* Set last read pointer */
if (POP3->num_msgs > 0) {
-
lgetuser
(&CC->user, CC->curr_user);
+
CtdlGetUserLock
(&CC->user, CC->curr_user);
CtdlGetRelationship(&vbuf, &CC->user, &CC->room);
snprintf(vbuf.v_seen, sizeof vbuf.v_seen, "*:%ld",
POP3->msgs[POP3->num_msgs-1].msgnum);
CtdlSetRelationship(&vbuf, &CC->user, &CC->room);
CtdlGetRelationship(&vbuf, &CC->user, &CC->room);
snprintf(vbuf.v_seen, sizeof vbuf.v_seen, "*:%ld",
POP3->msgs[POP3->num_msgs-1].msgnum);
CtdlSetRelationship(&vbuf, &CC->user, &CC->room);
-
lputuser
(&CC->user);
+
CtdlPutUserLock
(&CC->user);
}
}
}
}
diff --git
a/citadel/modules/upgrade/serv_upgrade.c
b/citadel/modules/upgrade/serv_upgrade.c
index c7a7b7220c03b7e1d4a05e9bd47c64f6082a4fc7..de3eb9ab5227d7e17566f40279dad05f084513bb 100644
(file)
--- a/
citadel/modules/upgrade/serv_upgrade.c
+++ b/
citadel/modules/upgrade/serv_upgrade.c
@@
-71,12
+71,12
@@
void fix_sys_user_name(void)
char usernamekey[USERNAME_SIZE];
/** If we have a user called Citadel rename them to SYS_Citadel */
char usernamekey[USERNAME_SIZE];
/** If we have a user called Citadel rename them to SYS_Citadel */
- if (
getu
ser(&usbuf, "Citadel") == 0)
+ if (
CtdlGetU
ser(&usbuf, "Citadel") == 0)
{
rename_user("Citadel", "SYS_Citadel");
}
{
rename_user("Citadel", "SYS_Citadel");
}
- while (
getuserbyn
umber(&usbuf, 0) == 0)
+ while (
CtdlGetUserByN
umber(&usbuf, 0) == 0)
{
/* delete user with number 0 and no name */
if (IsEmptyStr(usbuf.fullname))
{
/* delete user with number 0 and no name */
if (IsEmptyStr(usbuf.fullname))
@@
-84,12
+84,12
@@
void fix_sys_user_name(void)
else
{ /* temporarily set this user to -1 */
usbuf.usernum = -1;
else
{ /* temporarily set this user to -1 */
usbuf.usernum = -1;
-
putu
ser(&usbuf);
+
CtdlPutU
ser(&usbuf);
}
}
/** Make sure user SYS_* is user 0 */
}
}
/** Make sure user SYS_* is user 0 */
- while (
getuserbyn
umber(&usbuf, -1) == 0)
+ while (
CtdlGetUserByN
umber(&usbuf, -1) == 0)
{
if (strncmp(usbuf.fullname, "SYS_", 4))
{ /** Delete any user 0 that doesn't start with SYS_ */
{
if (strncmp(usbuf.fullname, "SYS_", 4))
{ /** Delete any user 0 that doesn't start with SYS_ */
@@
-99,7
+99,7
@@
void fix_sys_user_name(void)
else
{
usbuf.usernum = 0;
else
{
usbuf.usernum = 0;
-
putu
ser(&usbuf);
+
CtdlPutU
ser(&usbuf);
}
}
}
}
}
}
@@
-185,12
+185,12
@@
void cbtm_backend(struct ctdluser *usbuf, void *data) {
while (uplist != NULL) {
while (uplist != NULL) {
- if (
lgetuser
(&us, uplist->user) == 0) {
+ if (
CtdlGetUserLock
(&us, uplist->user) == 0) {
CtdlLogPrintf(CTDL_DEBUG, "Processing <%s>...\n", uplist->user);
if (us.uid == CTDLUID) {
us.uid = (-1);
}
CtdlLogPrintf(CTDL_DEBUG, "Processing <%s>...\n", uplist->user);
if (us.uid == CTDLUID) {
us.uid = (-1);
}
-
lputuser
(&us);
+
CtdlPutUserLock
(&us);
}
ptr = uplist;
}
ptr = uplist;
diff --git
a/citadel/modules/vcard/serv_vcard.c
b/citadel/modules/vcard/serv_vcard.c
index a4e92d234f352af62d0d6d51e1df5ca232ae2fe9..ff5c2ab4726a627fad3e81e400a7373f11d439a5 100644
(file)
--- a/
citadel/modules/vcard/serv_vcard.c
+++ b/
citadel/modules/vcard/serv_vcard.c
@@
-379,7
+379,7
@@
int vcard_upload_beforesave(struct CtdlMessage *msg) {
memcpy(&usbuf, &CC->user, sizeof(struct ctdluser));
}
memcpy(&usbuf, &CC->user, sizeof(struct ctdluser));
}
- else if (
getuserbyn
umber(&usbuf, what_user) == 0) {
+ else if (
CtdlGetUserByN
umber(&usbuf, what_user) == 0) {
/* We fetched a valid user record */
}
/* We fetched a valid user record */
}
@@
-500,7
+500,7
@@
int vcard_upload_aftersave(struct CtdlMessage *msg) {
if ( (strlen(CC->room.QRname) >= 12) && (!strcasecmp(&CC->room.QRname[11], USERCONFIGROOM)) ) {
is_UserConf = 1; /* It's someone's config room */
}
if ( (strlen(CC->room.QRname) >= 12) && (!strcasecmp(&CC->room.QRname[11], USERCONFIGROOM)) ) {
is_UserConf = 1; /* It's someone's config room */
}
- MailboxName(roomname, sizeof roomname, &CC->user, USERCONFIGROOM);
+
Ctdl
MailboxName(roomname, sizeof roomname, &CC->user, USERCONFIGROOM);
if (!strcasecmp(CC->room.QRname, roomname)) {
is_UserConf = 1;
is_MY_UserConf = 1; /* It's MY config room */
if (!strcasecmp(CC->room.QRname, roomname)) {
is_UserConf = 1;
is_MY_UserConf = 1; /* It's MY config room */
@@
-553,18
+553,18
@@
int vcard_upload_aftersave(struct CtdlMessage *msg) {
* Assume they don't need validating.
*/
if (CC->user.axlevel >= 6) {
* Assume they don't need validating.
*/
if (CC->user.axlevel >= 6) {
-
lgetuser
(&CC->user, CC->curr_user);
+
CtdlGetUserLock
(&CC->user, CC->curr_user);
CC->user.flags |= US_REGIS;
CC->user.flags |= US_REGIS;
-
lputuser
(&CC->user);
+
CtdlPutUserLock
(&CC->user);
return (0);
}
set_mm_valid();
/* ...which also means we need to flag the user */
return (0);
}
set_mm_valid();
/* ...which also means we need to flag the user */
-
lgetuser
(&CC->user, CC->curr_user);
+
CtdlGetUserLock
(&CC->user, CC->curr_user);
CC->user.flags |= (US_REGIS|US_NEEDVALID);
CC->user.flags |= (US_REGIS|US_NEEDVALID);
-
lputuser
(&CC->user);
+
CtdlPutUserLock
(&CC->user);
return(0);
}
return(0);
}
@@
-601,7
+601,7
@@
struct vCard *vcard_get_user(struct ctdluser *u) {
long VCmsgnum;
strcpy(hold_rm, CC->room.QRname); /* save current room */
long VCmsgnum;
strcpy(hold_rm, CC->room.QRname); /* save current room */
- MailboxName(config_rm, sizeof config_rm, u, USERCONFIGROOM);
+
Ctdl
MailboxName(config_rm, sizeof config_rm, u, USERCONFIGROOM);
if (CtdlGetRoom(&CC->room, config_rm) != 0) {
CtdlGetRoom(&CC->room, hold_rm);
if (CtdlGetRoom(&CC->room, config_rm) != 0) {
CtdlGetRoom(&CC->room, hold_rm);
@@
-754,7
+754,7
@@
void cmd_greg(char *argbuf)
return;
}
return;
}
- if (
getu
ser(&usbuf, who) != 0) {
+ if (
CtdlGetU
ser(&usbuf, who) != 0) {
cprintf("%d '%s' not found.\n", ERROR + NO_SUCH_USER, who);
return;
}
cprintf("%d '%s' not found.\n", ERROR + NO_SUCH_USER, who);
return;
}
diff --git
a/citadel/msgbase.c
b/citadel/msgbase.c
index 357dd1162804ae1096002c64cd784f8ebcb486f4..53d0fccbaca34607e590e09a0d5513c62e20ac73 100644
(file)
--- a/
citadel/msgbase.c
+++ b/
citadel/msgbase.c
@@
-2927,7
+2927,7
@@
long CtdlSubmitMsg(struct CtdlMessage *msg, /* message to save */
if (CtdlGetUser(&userbuf, recipient) == 0) {
// Add a flag so the Funambol module knows its mail
msg->cm_fields['W'] = strdup(recipient);
if (CtdlGetUser(&userbuf, recipient) == 0) {
// Add a flag so the Funambol module knows its mail
msg->cm_fields['W'] = strdup(recipient);
- MailboxName(actual_rm, sizeof actual_rm, &userbuf, MAILROOM);
+
Ctdl
MailboxName(actual_rm, sizeof actual_rm, &userbuf, MAILROOM);
CtdlSaveMsgPointerInRoom(actual_rm, newmsgid, 0, msg);
BumpNewMailCounter(userbuf.usernum);
if (!IsEmptyStr(config.c_funambol_host) || !IsEmptyStr(config.c_pager_program)) {
CtdlSaveMsgPointerInRoom(actual_rm, newmsgid, 0, msg);
BumpNewMailCounter(userbuf.usernum);
if (!IsEmptyStr(config.c_funambol_host) || !IsEmptyStr(config.c_pager_program)) {
@@
-3065,7
+3065,7
@@
long CtdlSubmitMsg(struct CtdlMessage *msg, /* message to save */
if (collected_addresses != NULL) {
aptr = (struct addresses_to_be_filed *)
malloc(sizeof(struct addresses_to_be_filed));
if (collected_addresses != NULL) {
aptr = (struct addresses_to_be_filed *)
malloc(sizeof(struct addresses_to_be_filed));
- MailboxName(actual_rm, sizeof actual_rm,
+
Ctdl
MailboxName(actual_rm, sizeof actual_rm,
&CCC->user, USERCONTACTSROOM);
aptr->roomname = strdup(actual_rm);
aptr->collected_addresses = collected_addresses;
&CCC->user, USERCONTACTSROOM);
aptr->roomname = strdup(actual_rm);
aptr->collected_addresses = collected_addresses;
@@
-4585,7
+4585,7
@@
void CtdlWriteObject(char *req_room, /* Room to stuff it in */
char *encoded_message = NULL;
if (is_mailbox != NULL) {
char *encoded_message = NULL;
if (is_mailbox != NULL) {
- MailboxName(roomname, sizeof roomname, is_mailbox, req_room);
+
Ctdl
MailboxName(roomname, sizeof roomname, is_mailbox, req_room);
}
else {
safestrncpy(roomname, req_room, sizeof(roomname));
}
else {
safestrncpy(roomname, req_room, sizeof(roomname));
diff --git
a/citadel/room_ops.c
b/citadel/room_ops.c
index f0c5cc98ea81f106f8bde29d7664df1457107ace..386c3c9947c184976dcaeb1af80decc824df2048 100644
(file)
--- a/
citadel/room_ops.c
+++ b/
citadel/room_ops.c
@@
-1030,7
+1030,7
@@
void cmd_goto(char *gargs)
/* Then try a mailbox name match */
if (c != 0) {
/* Then try a mailbox name match */
if (c != 0) {
- MailboxName(augmented_roomname, sizeof augmented_roomname,
+
Ctdl
MailboxName(augmented_roomname, sizeof augmented_roomname,
&CC->user, towhere);
c = CtdlGetRoom(&QRscratch, augmented_roomname);
if (c == 0)
&CC->user, towhere);
c = CtdlGetRoom(&QRscratch, augmented_roomname);
if (c == 0)
@@
-1512,7
+1512,7
@@
void cmd_geta(char *cmdbuf)
if (CtdlAccessCheck(ac_logged_in)) return;
if (CtdlAccessCheck(ac_logged_in)) return;
- if (
getuserbyn
umber(&usbuf, CC->room.QRroomaide) == 0) {
+ if (
CtdlGetUserByN
umber(&usbuf, CC->room.QRroomaide) == 0) {
cprintf("%d %s\n", CIT_OK, usbuf.fullname);
} else {
cprintf("%d \n", CIT_OK);
cprintf("%d %s\n", CIT_OK, usbuf.fullname);
} else {
cprintf("%d \n", CIT_OK);
@@
-1795,7
+1795,7
@@
unsigned CtdlCreateRoom(char *new_room_name,
* name accordingly (prepend the user number)
*/
if (new_room_type == 4) {
* name accordingly (prepend the user number)
*/
if (new_room_type == 4) {
- MailboxName(qrbuf.QRname, sizeof qrbuf.QRname, &CC->user, new_room_name);
+
Ctdl
MailboxName(qrbuf.QRname, sizeof qrbuf.QRname, &CC->user, new_room_name);
}
else {
safestrncpy(qrbuf.QRname, new_room_name, sizeof qrbuf.QRname);
}
else {
safestrncpy(qrbuf.QRname, new_room_name, sizeof qrbuf.QRname);
diff --git
a/citadel/user_ops.c
b/citadel/user_ops.c
index 7c96a1e9f5d6c7eb4c84a832aa75dfceacffbf7d..91e3d077a56934c3c72b4f0ef6d4feb1071d61d7 100644
(file)
--- a/
citadel/user_ops.c
+++ b/
citadel/user_ops.c
@@
-361,6
+361,12
@@
void CtdlGetRelationship(struct visit *vbuf,
}
}
+void CtdlMailboxName(char *buf, size_t n, const struct ctdluser *who, const char *prefix)
+{
+ snprintf(buf, n, "%010ld.%s", who->usernum, prefix);
+}
+
+
void MailboxName(char *buf, size_t n, const struct ctdluser *who, const char *prefix)
{
snprintf(buf, n, "%010ld.%s", who->usernum, prefix);
void MailboxName(char *buf, size_t n, const struct ctdluser *who, const char *prefix)
{
snprintf(buf, n, "%010ld.%s", who->usernum, prefix);
@@
-1182,10
+1188,10
@@
int create_user(char *newusername, int become_user)
* Give the user a private mailbox and a configuration room.
* Make the latter an invisible system room.
*/
* Give the user a private mailbox and a configuration room.
* Make the latter an invisible system room.
*/
- MailboxName(mailboxname, sizeof mailboxname, &usbuf, MAILROOM);
+
Ctdl
MailboxName(mailboxname, sizeof mailboxname, &usbuf, MAILROOM);
CtdlCreateRoom(mailboxname, 5, "", 0, 1, 1, VIEW_MAILBOX);
CtdlCreateRoom(mailboxname, 5, "", 0, 1, 1, VIEW_MAILBOX);
- MailboxName(mailboxname, sizeof mailboxname, &usbuf, USERCONFIGROOM);
+
Ctdl
MailboxName(mailboxname, sizeof mailboxname, &usbuf, USERCONFIGROOM);
CtdlCreateRoom(mailboxname, 5, "", 0, 1, 1, VIEW_BBS);
if (CtdlGetRoomLock(&qrbuf, mailboxname) == 0) {
qrbuf.QRflags2 |= QR2_SYSTEM;
CtdlCreateRoom(mailboxname, 5, "", 0, 1, 1, VIEW_BBS);
if (CtdlGetRoomLock(&qrbuf, mailboxname) == 0) {
qrbuf.QRflags2 |= QR2_SYSTEM;
@@
-1970,7
+1976,7
@@
int InitialMailCheck()
long *msglist = NULL;
int num_msgs = 0;
long *msglist = NULL;
int num_msgs = 0;
- MailboxName(mailboxname, sizeof mailboxname, &CC->user, MAILROOM);
+
Ctdl
MailboxName(mailboxname, sizeof mailboxname, &CC->user, MAILROOM);
if (CtdlGetRoom(&mailbox, mailboxname) != 0)
return (0);
CtdlGetRelationship(&vbuf, &CC->user, &mailbox);
if (CtdlGetRoom(&mailbox, mailboxname) != 0)
return (0);
CtdlGetRelationship(&vbuf, &CC->user, &mailbox);
diff --git
a/citadel/user_ops.h
b/citadel/user_ops.h
index 1a61e34dcd633f2223cf77a2cc345c1085590b60..5057ade2a9a4088bb32cae79c31bc334f7deb09f 100644
(file)
--- a/
citadel/user_ops.h
+++ b/
citadel/user_ops.h
@@
-27,14
+27,9
@@
void ListThisUser(struct ctdluser *usbuf, void *data);
int NewMailCount(void);
int InitialMailCheck(void);
void put_visit(struct visit *newvisit);
int NewMailCount(void);
int InitialMailCheck(void);
void put_visit(struct visit *newvisit);
-void CtdlGetRelationship(struct visit *vbuf,
- struct ctdluser *rel_user,
- struct ctdlroom *rel_room);
-void CtdlSetRelationship(struct visit *newvisit,
- struct ctdluser *rel_user,
- struct ctdlroom *rel_room);
+/* MailboxName is deprecated us CtdlMailboxName instead */
void MailboxName(char *buf, size_t n, const struct ctdluser *who,
void MailboxName(char *buf, size_t n, const struct ctdluser *who,
- const char *prefix);
+ const char *prefix)
__attribute__ ((deprecated))
;
int GenerateRelationshipIndex( char *IndexBuf,
long RoomID,
long RoomGen,
int GenerateRelationshipIndex( char *IndexBuf,
long RoomID,
long RoomGen,