diff --git a/src/sbbs3/js_msgbase.c b/src/sbbs3/js_msgbase.c index 51adcd4a8cde0a490b32bd5edbc2ec9e66d98c4d..9c0ac1d30d2772c6df119509afd0bfe1fdce0238 100644 --- a/src/sbbs3/js_msgbase.c +++ b/src/sbbs3/js_msgbase.c @@ -374,6 +374,39 @@ static BOOL parse_header_object(JSContext* cx, private_t* p, JSObject* hdr, smbm return(TRUE); } +/****************************************************************************/ +/* Retrieve a message by RFC822 message-ID */ +/****************************************************************************/ +BOOL DLLCALL get_msg_by_id(scfg_t* scfg, smb_t* smb, char* id, smbmsg_t* msg) +{ + ulong n; + int ret; + + for(n=0;n<smb->status.last_msg;n++) { + memset(msg,0,sizeof(smbmsg_t)); + msg->offset=n; + if(smb_getmsgidx(smb, msg)!=0) + break; + + if(smb_lockmsghdr(smb,msg)!=0) + continue; + + ret=smb_getmsghdr(smb,msg); + + smb_unlockmsghdr(smb,msg); + + if(ret!=SMB_SUCCESS) + continue; + + if(strcmp(get_msgid(scfg,smb->subnum,msg),id)==0) + return(TRUE); + + smb_freemsgmem(msg); + } + + return(FALSE); +} + BOOL msg_offset_by_id(scfg_t* scfg, smb_t* smb, char* id, ulong* offset) { smbmsg_t msg; diff --git a/src/sbbs3/str_util.c b/src/sbbs3/str_util.c index d70267b3db06532eadbd05936532708bd7dba7e4..ff13347d8f86466d808475b78061e58768fedc02 100644 --- a/src/sbbs3/str_util.c +++ b/src/sbbs3/str_util.c @@ -384,38 +384,6 @@ char* DLLCALL get_msgid(scfg_t* cfg, uint subnum, smbmsg_t* msg) return(msgid); } -/****************************************************************************/ -/* Retrieve a message by RFC822 message-ID */ -/****************************************************************************/ -BOOL DLLCALL get_msg_by_id(scfg_t* scfg, smb_t* smb, char* id, smbmsg_t* msg) -{ - ulong n; - int ret; - - for(n=0;n<smb->status.last_msg;n++) { - memset(msg,0,sizeof(smbmsg_t)); - msg->offset=n; - if(smb_getmsgidx(smb, msg)!=0) - break; - - if(smb_lockmsghdr(smb,msg)!=0) - continue; - - ret=smb_getmsghdr(smb,msg); - - smb_unlockmsghdr(smb,msg); - - if(ret!=SMB_SUCCESS) - continue; - - if(strcmp(get_msgid(scfg,smb->subnum,msg),id)==0) - return(TRUE); - - smb_freemsgmem(msg); - } - - return(FALSE); -} /****************************************************************************/ /* Returns string for 2 digit hex+ numbers up to 575 */