Unlimited reply link chain (max was 30 replies)

This commit is contained in:
Ianos Gnatiuc 2006-05-15 06:20:57 +00:00
parent b322344dae
commit b3496843dd
9 changed files with 80 additions and 53 deletions

View File

@ -10,8 +10,9 @@ _____________________________________________________________________________
‡ ¬¥âª¨ ¤«ï GoldED+ 1.1.5, /snapshot/ ‡ ¬¥âª¨ ¤«ï GoldED+ 1.1.5, /snapshot/
_____________________________________________________________________________ _____________________________________________________________________________
+ <20>¥®£à ­¨ç¥­­®¥ ç¨á«® «¨­ª®¢ ­  ¯¨á쬮 ¢ ¤¥à¥¢¥ ®â¢¥â®¢ (¡ë«® 30).
- ˆá¯à ¢«¥­® "§ ¢¨á ­¨¥" ª« ¢¨ âãàë ¢ Win32. - ˆá¯à ¢«¥­® "§ ¢¨á ­¨¥" ª« ¢¨ âãàë ¢ Win32.
+ “«ãç襭® à á¯®§­ ¢ ­¨¥ ¯à¨ ª¢®â¨­£ . + “«ãç襭® à á¯®§­ ¢ ­¨¥ ¯à¨ ª¢®â¨­£¥.
! Š«îç¥¢ë¥ á«®¢  ¤«ï ª« ¢¨è à¨á®¢ ­¨ï «¨­¨© ¨§¬¥­¥­ë á EditGo* ­  EditBlock*. ! Š«îç¥¢ë¥ á«®¢  ¤«ï ª« ¢¨è à¨á®¢ ­¨ï «¨­¨© ¨§¬¥­¥­ë á EditGo* ­  EditBlock*.
+ SCheckerDefLang ¬®¦¥â ¨á¯®«ì§®¢ âìáï ¢ £à㯯 å (Random Group). + SCheckerDefLang ¬®¦¥â ¨á¯®«ì§®¢ âìáï ¢ £à㯯 å (Random Group).
+ Win32: ⥯¥àì ¨¤¥­â¨ä¨ª â®à ï§ëª  MS Spellcheker ¯à¥¤áâ ¢«¥­ ¢ ¯®­ïâ­®© ä®à¬¥ + Win32: ⥯¥àì ¨¤¥­â¨ä¨ª â®à ï§ëª  MS Spellcheker ¯à¥¤áâ ¢«¥­ ¢ ¯®­ïâ­®© ä®à¬¥
@ -22,8 +23,8 @@ _____________________________________________________________________________
‘­ ¯è®â ®â 26 ¬ àâ  2006: ¨§¬¥­¥­¨ï ®â­®á¨â¥«ì­® á­ ¯è®â  ®â 12 ¬ àâ  2006. ‘­ ¯è®â ®â 26 ¬ àâ  2006: ¨§¬¥­¥­¨ï ®â­®á¨â¥«ì­® á­ ¯è®â  ®â 12 ¬ àâ  2006.
- GoldEd ­¥ ¨á¯®«ì§ã¥â â ¡«¨æã ¯¥à¥ª®¤¨à®¢®ª, ¥á«¨ ã஢¥­ì ¬¥­ìè¥, 祬 ã஢¥­ì - GoldEd ­¥ ¨á¯®«ì§ã¥â â ¡«¨æã ¯¥à¥ª®¤¨à®¢®ª, ¥á«¨ ¥ñ ã஢¥­ì ¬¥­ìè¥, 祬
CHRS-ª«ã¤¦ . ã஢¥­ì CHRS-ª«ã¤¦ .
- ˆá¯à ¢«¥­® ®â®¡à ¦¥­¨¥ ¨­¨æ¨ «®¢ ¯à¨ ¨á¯®«ì§®¢ ­¨¨ "á।­¥£® ¨¬¥­¨" (M): - ˆá¯à ¢«¥­® ®â®¡à ¦¥­¨¥ ¨­¨æ¨ «®¢ ¯à¨ ¨á¯®«ì§®¢ ­¨¨ "á।­¥£® ¨¬¥­¨" (M):
QuoteString " FML> " QuoteString " FML> "
- ˆá¯à ¢«¥­® "®¡à¥§ ­¨¥" ¤ âë ¨ ¢à¥¬¥­¨ ¯à¨ ®â®¡à ¦¥­¨¨ § £®«®¢ª®¢ á®®¡é¥­¨ï. - ˆá¯à ¢«¥­® "®¡à¥§ ­¨¥" ¤ âë ¨ ¢à¥¬¥­¨ ¯à¨ ®â®¡à ¦¥­¨¨ § £®«®¢ª®¢ á®®¡é¥­¨ï.

View File

@ -10,6 +10,8 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/ Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________ ______________________________________________________________________
+ Unlimited reply link chain (max was 30 replies).
- Fixed keyboard deadlock on win32. - Fixed keyboard deadlock on win32.
+ Improved false quote handling. + Improved false quote handling.

View File

@ -1051,12 +1051,12 @@ void GThreadlist::recursive_build(uint32_t msgn, uint32_t rn, uint32_t level) {
recursive_build(msg.link.first(), msg.link.list(0), level+1); recursive_build(msg.link.first(), msg.link.list(0), level+1);
for(int n=0; n < msg.link.list_max()-1; n++) { for(size_t n = 0, max = msg.link.list_max(); n < max; n++)
if(msg.link.list(n)) { {
if (msg.link.list(n))
recursive_build(msg.link.list(n), msg.link.list(n+1), level+1); recursive_build(msg.link.list(n), msg.link.list(n+1), level+1);
} else
break;
} }
AA->LoadHdr(&msg, oldmsgno); AA->LoadHdr(&msg, oldmsgno);
} }
} }

View File

@ -220,19 +220,16 @@ void MarkMsgs_Txt(int item, char* markstring) {
static void recursive_mark(GMsg* msg, uint32_t msgno, bool markasread) static void recursive_mark(GMsg* msg, uint32_t msgno, bool markasread)
{ {
int i; if (AA->Msgn.ToReln(msgno) and AA->LoadHdr(msg, msgno, false))
gmsg_links templink; {
gmsg_links templink = msg->link;
if(AA->Msgn.ToReln(msgno) and AA->LoadHdr(msg, msgno, false)) {
templink = msg->link;
if (!markasread) if (!markasread)
{ {
if (templink.first()) if (templink.first())
AA->Mark.Add(templink.first()); AA->Mark.Add(templink.first());
for(i = 0; i < templink.list_max(); i++) for (size_t i = 0, max = templink.list_max(); i < max; i++)
{ {
if (templink.list(i)) if (templink.list(i))
AA->Mark.Add(templink.list(i)); AA->Mark.Add(templink.list(i));
@ -247,13 +244,13 @@ static void recursive_mark(GMsg* msg, uint32_t msgno, bool markasread)
if (templink.first()) if (templink.first())
recursive_mark(msg, templink.first(), markasread); recursive_mark(msg, templink.first(), markasread);
for(i = 0; i < templink.list_max(); i++) { for (size_t i = 0, max = templink.list_max(); i < max; i++)
if(templink.list(i)) { {
if (templink.list(i))
recursive_mark(msg, templink.list(i), markasread); recursive_mark(msg, templink.list(i), markasread);
} }
} }
} }
}
// ------------------------------------------------------------------ // ------------------------------------------------------------------

View File

@ -1151,17 +1151,22 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
if(AA->LoadHdr(reply, reply_msgno, false)) { if(AA->LoadHdr(reply, reply_msgno, false)) {
uint32_t replynext; uint32_t replynext;
bool ok2save = false; bool ok2save = false;
if(streql(AA->basetype(), "SQUISH")) {
if(reply->link.first()) { if (streql(AA->basetype(), "SQUISH"))
for(int r=0; r<reply->link.list_max()-1; r++) { {
if(reply->link.list(r) == 0) { if (reply->link.first())
{
for (size_t r = 0; !ok2save; r++)
{
if (reply->link.list(r) == 0)
{
reply->link.list_set(r, msg->msgno); reply->link.list_set(r, msg->msgno);
ok2save = true; ok2save = true;
break;
} }
} }
} }
else { else
{
reply->link.first_set(msg->msgno); reply->link.first_set(msg->msgno);
ok2save = true; ok2save = true;
} }

View File

@ -1052,14 +1052,16 @@ void Reader() {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Determine if the message has replies // Determine if the message has replies
uint32_t MsgHasReplies(GMsg* msg) { uint32_t MsgHasReplies(GMsg* msg)
{
if (msg->link.first()) if (msg->link.first())
return msg->link.first(); return msg->link.first();
for(int n=0; n<msg->link.list_max(); n++) for (size_t n = 0, max = msg->link.list_max(); n < max; n++)
{
if (msg->link.list(n)) if (msg->link.list(n))
return msg->link.list(n); return msg->link.list(n);
}
if (msg->link.next()) if (msg->link.next())
return msg->link.next(); return msg->link.next();

View File

@ -39,6 +39,8 @@
#include <gvidall.h> #include <gvidall.h>
#include <gmsgattr.h> #include <gmsgattr.h>
#include <vector>
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Internet name typedefs // Internet name typedefs
@ -180,37 +182,53 @@ Line* AddHexdump(Line*& line, void* data, size_t datalen);
// ------------------------------------------------------------------ // ------------------------------------------------------------------
class gmsg_links { class gmsg_links
{
private: private:
enum { list_limit = 29 };
uint32_t reply_to; uint32_t reply_to;
uint32_t reply_first; uint32_t reply_first;
uint32_t reply_list[list_limit];
uint32_t reply_next; uint32_t reply_next;
std::vector<uint32_t> reply_list;
public: public:
void reset() { void reset()
{
reply_to = reply_first = reply_next = 0; reply_to = reply_first = reply_next = 0;
for(int n=0; n<list_max(); n++) reply_list.clear();
reply_list[n] = 0;
} }
int list_max() const { return list_limit; } int list_max() const { return reply_list.size(); }
void to_set(uint32_t m) { reply_to = m; } void to_set(uint32_t m) { reply_to = m; }
void first_set(uint32_t m) { reply_first = m; } void first_set(uint32_t m) { reply_first = m; }
void list_set(int n, uint32_t m) { reply_list[n] = m; }
void next_set(uint32_t m) { reply_next = m; } void next_set(uint32_t m) { reply_next = m; }
void list_set(size_t n, uint32_t m)
{
size_t size = reply_list.size();
if (n >= size)
{
for (size_t i = size; i <= n; i++)
reply_list.push_back(0);
}
reply_list[n] = m;
}
uint32_t to() const { return reply_to; } uint32_t to() const { return reply_to; }
uint32_t first() const { return reply_first; } uint32_t first() const { return reply_first; }
uint32_t list(int n) const { return reply_list[n]; }
uint32_t next() const { return reply_next; } uint32_t next() const { return reply_next; }
uint32_t list(size_t n) const
{
if (n >= reply_list.size())
return 0;
return reply_list[n];
}
}; };

View File

@ -313,10 +313,12 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
throw_free(_subfield); throw_free(_subfield);
// Get reply numbers in chain // Get reply numbers in chain
if(wide->lookreplies and __msg->link.first()) { if (wide->lookreplies and __msg->link.first())
{
int r = 0; int r = 0;
uint32_t m = __msg->link.first(); uint32_t m = __msg->link.first();
while(m and (r < __msg->link.list_max())) { while (m)
{
JamHdr _rhdr; JamHdr _rhdr;
memset(&_rhdr, 0, sizeof(JamHdr)); memset(&_rhdr, 0, sizeof(JamHdr));
lseekset(data->fhjdx, m-data->hdrinfo.basemsgnum, sizeof(JamIndex)); lseekset(data->fhjdx, m-data->hdrinfo.basemsgnum, sizeof(JamIndex));
@ -324,8 +326,7 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
lseekset(data->fhjhr, _idx.hdroffset); lseekset(data->fhjhr, _idx.hdroffset);
read(data->fhjhr, &_rhdr, sizeof(JamHdr)); read(data->fhjhr, &_rhdr, sizeof(JamHdr));
m = _rhdr.replynext; m = _rhdr.replynext;
if(m) if (m) __msg->link.list_set(r++, m);
__msg->link.list_set(r++, m);
} }
} }

View File

@ -107,7 +107,8 @@ int SquishArea::load_message(int __mode, gmsg* __msg, SqshHdr& __hdr) {
// Convert link.list // Convert link.list
int q = 0; int q = 0;
int r = __hdr.replies[0] == __hdr.replies[1] ? 2 : 1; int r = __hdr.replies[0] == __hdr.replies[1] ? 2 : 1;
while(r<=8) { while (r <= 8)
{
if (__hdr.replies[r] and __hdr.replies[r-1] != __hdr.replies[r]) if (__hdr.replies[r] and __hdr.replies[r-1] != __hdr.replies[r])
__msg->link.list_set(q++, __hdr.replies[r]); __msg->link.list_set(q++, __hdr.replies[r]);
r++; r++;