projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
36c5c7e
)
* Modified the text client so that the <E>nter message command does not work in room...
author
Art Cancro
<ajc@citadel.org>
Wed, 25 Nov 2009 20:38:42 +0000
(20:38 +0000)
committer
Art Cancro
<ajc@citadel.org>
Wed, 25 Nov 2009 20:38:42 +0000
(20:38 +0000)
citadel/include/citadel_ipc.h
patch
|
blob
|
history
citadel/modules/wiki/serv_wiki.c
patch
|
blob
|
history
citadel/textclient/citadel.c
patch
|
blob
|
history
citadel/textclient/messages.c
patch
|
blob
|
history
citadel/utillib/citadel_ipc.c
patch
|
blob
|
history
diff --git
a/citadel/include/citadel_ipc.h
b/citadel/include/citadel_ipc.h
index 01b0636223b784d142d4d600fb1326612814251f..36611e0e2a6398410e703d96815db78b371609f3 100644
(file)
--- a/
citadel/include/citadel_ipc.h
+++ b/
citadel/include/citadel_ipc.h
@@
-113,6
+113,8
@@
struct ctdlipcroom {
char RRaide; /* User can do aide commands in room */
long RRnewmail; /* Number of new mail messages */
char RRfloor; /* Which floor this room is on */
char RRaide; /* User can do aide commands in room */
long RRnewmail; /* Number of new mail messages */
char RRfloor; /* Which floor this room is on */
+ char RRcurrentview; /* The user's current view for this room */
+ char RRdefaultview; /* The default view for this room */
};
};
diff --git
a/citadel/modules/wiki/serv_wiki.c
b/citadel/modules/wiki/serv_wiki.c
index 6ae8eda01337959fc060c2c4d9fffe3c2dbed9fe..df46e1b3de54a5c691efa88dc1e00594c80da4b7 100644
(file)
--- a/
citadel/modules/wiki/serv_wiki.c
+++ b/
citadel/modules/wiki/serv_wiki.c
@@
-108,8
+108,9
@@
int wiki_upload_beforesave(struct CtdlMessage *msg) {
/* If this isn't a MIME message, don't bother. */
if (msg->cm_format_type != 4) return(0);
/* If this isn't a MIME message, don't bother. */
if (msg->cm_format_type != 4) return(0);
- /* If there's no EUID we can't do this. */
- if (msg->cm_fields['E'] == NULL) return(0);
+ /* If there's no EUID we can't do this. Reject the post. */
+ if (msg->cm_fields['E'] == NULL) return(1);
+
snprintf(history_page, sizeof history_page, "%s_HISTORY_", msg->cm_fields['E']);
/* Make sure we're saving a real wiki page rather than a wiki history page.
snprintf(history_page, sizeof history_page, "%s_HISTORY_", msg->cm_fields['E']);
/* Make sure we're saving a real wiki page rather than a wiki history page.
@@
-132,7
+133,7
@@
int wiki_upload_beforesave(struct CtdlMessage *msg) {
msg->cm_fields['U'] = strdup(msg->cm_fields['E']);
/* See if we can retrieve the previous version. */
msg->cm_fields['U'] = strdup(msg->cm_fields['E']);
/* See if we can retrieve the previous version. */
- old_msgnum =
locate_message_by_e
uid(msg->cm_fields['E'], &CCC->room);
+ old_msgnum =
CtdlLocateMessageByE
uid(msg->cm_fields['E'], &CCC->room);
if (old_msgnum > 0L) {
old_msg = CtdlFetchMessage(old_msgnum, 1);
}
if (old_msgnum > 0L) {
old_msg = CtdlFetchMessage(old_msgnum, 1);
}
@@
-203,7
+204,7
@@
int wiki_upload_beforesave(struct CtdlMessage *msg) {
/* Now look for the existing edit history */
/* Now look for the existing edit history */
- history_msgnum =
locate_message_by_e
uid(history_page, &CCC->room);
+ history_msgnum =
CtdlLocateMessageByE
uid(history_page, &CCC->room);
history_msg = NULL;
if (history_msgnum > 0L) {
history_msg = CtdlFetchMessage(history_msgnum, 1);
history_msg = NULL;
if (history_msgnum > 0L) {
history_msg = CtdlFetchMessage(history_msgnum, 1);
@@
-365,7
+366,7
@@
void wiki_history(char *pagename) {
}
snprintf(history_page_name, sizeof history_page_name, "%s_HISTORY_", pagename);
}
snprintf(history_page_name, sizeof history_page_name, "%s_HISTORY_", pagename);
- msgnum =
locate_message_by_e
uid(history_page_name, &CC->room);
+ msgnum =
CtdlLocateMessageByE
uid(history_page_name, &CC->room);
if (msgnum > 0L) {
msg = CtdlFetchMessage(msgnum, 1);
}
if (msgnum > 0L) {
msg = CtdlFetchMessage(msgnum, 1);
}
@@
-489,7
+490,7
@@
void wiki_rev(char *pagename, char *rev, char *operation)
/* Begin by fetching the current version of the page. We're going to patch
* backwards through the diffs until we get the one we want.
*/
/* Begin by fetching the current version of the page. We're going to patch
* backwards through the diffs until we get the one we want.
*/
- msgnum =
locate_message_by_e
uid(pagename, &CC->room);
+ msgnum =
CtdlLocateMessageByE
uid(pagename, &CC->room);
if (msgnum > 0L) {
msg = CtdlFetchMessage(msgnum, 1);
}
if (msgnum > 0L) {
msg = CtdlFetchMessage(msgnum, 1);
}
@@
-523,7
+524,7
@@
void wiki_rev(char *pagename, char *rev, char *operation)
/* Get the revision history */
snprintf(history_page_name, sizeof history_page_name, "%s_HISTORY_", pagename);
/* Get the revision history */
snprintf(history_page_name, sizeof history_page_name, "%s_HISTORY_", pagename);
- msgnum =
locate_message_by_e
uid(history_page_name, &CC->room);
+ msgnum =
CtdlLocateMessageByE
uid(history_page_name, &CC->room);
if (msgnum > 0L) {
msg = CtdlFetchMessage(msgnum, 1);
}
if (msgnum > 0L) {
msg = CtdlFetchMessage(msgnum, 1);
}
diff --git
a/citadel/textclient/citadel.c
b/citadel/textclient/citadel.c
index 7e5ef874a2351bf2233c80e1a4b657bdce81c01f..ba6d6103fa736f66cac48af8fca26943ba7c39ed 100644
(file)
--- a/
citadel/textclient/citadel.c
+++ b/
citadel/textclient/citadel.c
@@
-92,6
+92,7
@@
int screenwidth;
int screenheight;
unsigned room_flags;
unsigned room_flags2;
int screenheight;
unsigned room_flags;
unsigned room_flags2;
+int entmsg_ok = 0;
char room_name[ROOMNAMELEN];
char *uglist[UGLISTLEN]; /* size of the ungoto list */
long uglistlsn[UGLISTLEN]; /* current read position for all the ungoto's. Not going to make any friends with this one. */
char room_name[ROOMNAMELEN];
char *uglist[UGLISTLEN]; /* size of the ungoto list */
long uglistlsn[UGLISTLEN]; /* current read position for all the ungoto's. Not going to make any friends with this one. */
@@
-470,6
+471,19
@@
void dotgoto(CtdlIPC *ipc, char *towhere, int display_name, int fromungoto)
from_floor = curr_floor;
curr_floor = room->RRfloor;
from_floor = curr_floor;
curr_floor = room->RRfloor;
+ /* Determine, based on the room's default view, whether an <E>nter message
+ * command will be valid here.
+ */
+ switch(room->RRdefaultview) {
+ case VIEW_BBS:
+ case VIEW_MAILBOX:
+ entmsg_ok = 1;
+ break;
+ default:
+ entmsg_ok = 0;
+ break;
+ }
+
remove_march(room_name, 0);
if (!strcasecmp(towhere, "_BASEROOM_"))
remove_march(towhere, 0);
remove_march(room_name, 0);
if (!strcasecmp(towhere, "_BASEROOM_"))
remove_march(towhere, 0);
diff --git
a/citadel/textclient/messages.c
b/citadel/textclient/messages.c
index fdd8d46b4c2649ad23967994f283bbddf4d04138..0434cd36d9f0918820753fec617b1d1973fe8435 100644
(file)
--- a/
citadel/textclient/messages.c
+++ b/
citadel/textclient/messages.c
@@
-74,6
+74,7
@@
extern char room_name[];
extern char tempdir[];
extern unsigned room_flags;
extern unsigned room_flags2;
extern char tempdir[];
extern unsigned room_flags;
extern unsigned room_flags2;
+extern int entmsg_ok;
extern long highest_msg_read;
extern char temp[];
extern char temp2[];
extern long highest_msg_read;
extern char temp[];
extern char temp2[];
@@
-1093,10
+1094,17
@@
int entmsg(CtdlIPC *ipc,
int r; /* IPC response code */
int subject_required = 0;
int r; /* IPC response code */
int subject_required = 0;
- if (c > 0)
+ if (!entmsg_ok) {
+ scr_printf("You may not enter messages in this type of room.\n");
+ return(1);
+ }
+
+ if (c > 0) {
mode = 1;
mode = 1;
- else
+ }
+ else {
mode = 0;
mode = 0;
+ }
strcpy(subject, "");
strcpy(subject, "");
diff --git
a/citadel/utillib/citadel_ipc.c
b/citadel/utillib/citadel_ipc.c
index ef902281dd69ae44310bc98799eb5de28abae09a..0ac29d4bbdf067e592d9f2afbf5e4c012d0fb75e 100644
(file)
--- a/
citadel/utillib/citadel_ipc.c
+++ b/
citadel/utillib/citadel_ipc.c
@@
-443,6
+443,9
@@
int CtdlIPCGotoRoom(CtdlIPC *ipc, const char *room, const char *passwd,
rret[0]->RRaide = extract_int(cret, 8);
rret[0]->RRnewmail = extract_long(cret, 9);
rret[0]->RRfloor = extract_int(cret, 10);
rret[0]->RRaide = extract_int(cret, 8);
rret[0]->RRnewmail = extract_long(cret, 9);
rret[0]->RRfloor = extract_int(cret, 10);
+ rret[0]->RRcurrentview = extract_int(cret, 11);
+ rret[0]->RRdefaultview = extract_int(cret, 12);
+ /* position 13 is a trash folder flag ... irrelevant in this client */
rret[0]->RRflags2 = extract_int(cret, 14);
} else {
free(*rret);
rret[0]->RRflags2 = extract_int(cret, 14);
} else {
free(*rret);