-/*
- * Copyright (c) 1987-2022 by the citadel.org team
- *
- * This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+// Copyright (c) 1987-2022 by the citadel.org team
+//
+// This program is open source software. Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License, version 3.
#include "../../ctdl_module.h"
#include "../../config.h"
#include <dirent.h>
-/*
- * DownLoad Room Image (see its icon or whatever)
- * If this command succeeds, it follows the same protocol as the DLAT command.
- */
+// DownLoad Room Image (see its icon or whatever)
+// If this command succeeds, it follows the same protocol as the DLAT command.
void cmd_dlri(char *cmdbuf) {
if (CtdlAccessCheck(ac_logged_in_or_guest)) return;
if (CC->room.msgnum_pic < 1) {
}
-/*
- * UpLoad Room Image (avatar or photo or whatever)
- */
+// UpLoad Room Image (avatar or photo or whatever)
void cmd_ulri(char *cmdbuf) {
long data_length;
char mimetype[SIZ];
}
-/*
- * DownLoad User Image (see their avatar or photo or whatever)
- * If this command succeeds, it follows the same protocol as the DLAT command.
- */
+// DownLoad User Image (see their avatar or photo or whatever)
+// If this command succeeds, it follows the same protocol as the DLAT command.
void cmd_dlui(char *cmdbuf) {
struct ctdluser ruser;
char buf[SIZ];
}
-/*
- * UpLoad User Image (avatar or photo or whatever)
- */
+// UpLoad User Image (avatar or photo or whatever)
void cmd_ului(char *cmdbuf) {
long data_length;
char mimetype[SIZ];
}
-/*
- * Import function called by import_old_userpic_files() for a single user
- */
+// Import function called by import_old_userpic_files() for a single user
void import_one_userpic_file(char *username, long usernum, char *path) {
syslog(LOG_DEBUG, "Import legacy userpic for %s, usernum=%ld, filename=%s", username, usernum, path);
}
-/*
- * Look for old-format "userpic" files and import them into the message base
- */
+// Look for old-format "userpic" files and import them into the message base
void import_old_userpic_files(void) {
DIR *filedir = NULL;
struct dirent *filedir_entry;
d_type = IFTODT(s.st_mode);
}
}
- switch (d_type)
- {
- case DT_DIR:
- break;
- case DT_LNK:
- case DT_REG:
- usernum = atol(filedir_entry->d_name);
- if (CtdlGetUserByNumber(&usbuf, usernum) == 0) {
- import_one_userpic_file(usbuf.fullname, usernum, path);
- }
+ switch (d_type) {
+ case DT_DIR:
+ break;
+ case DT_LNK:
+ case DT_REG:
+ usernum = atol(filedir_entry->d_name);
+ if (CtdlGetUserByNumber(&usbuf, usernum) == 0) {
+ import_one_userpic_file(usbuf.fullname, usernum, path);
+ }
}
}
closedir(filedir);
CtdlRegisterProtoHook(cmd_dlui, "DLUI", "DownLoad User Image");
CtdlRegisterProtoHook(cmd_ului, "ULUI", "UpLoad User Image");
}
- /* return our module name for the log */
+ // return our module name for the log
return "image";
}