OSDN Git Service

readme変更
[nlite/nlite.git] / nlite / nlite_chatData.cpp
index bc2d1b8..51ac8af 100644 (file)
@@ -34,21 +34,27 @@ user_id(TEXT("")),
 name(TEXT("")),
 community(TEXT("")),
 bgcolor(INIT_COLOR),
-writePropertyFlag(FALSE),
 time(0),
-onlyCommunityFlag(FALSE)
+onlyCommunityFlag(FALSE),
+nameColor(INIT_COLOR)
 {}
 
+VOID ListenerData::SetNameColor(COLORREF nameColor_in){
+       nameColor = nameColor_in;
+
+       return;
+}
+
 VOID ListenerData::SetBkColor(COLORREF bkColor_in){
        bgcolor = bkColor_in;
-       writePropertyFlag = TRUE;
+
        return;
 }
 
 VOID ListenerData::SetUserName(LPCTSTR name){
 
        this->name = name;
-       this->writePropertyFlag = TRUE;
+
 
 }
 
@@ -391,12 +397,13 @@ BOOL CListenerList::WriteProperty(LPCTSTR fileName){
        auto end = m_listenerList.end();
 
        for(;begin != end;++begin){
-               if(begin->writePropertyFlag == TRUE){
+               if(begin->name.Length() > 0 || begin->nameColor != ListenerData::INIT_COLOR || begin->bgcolor != ListenerData::INIT_COLOR){
                        pWriter->WriteStartElement(NULL,TEXT("user"),NULL);
                        if(begin->name.Length() > 0) NLITE_ATTRIBUTE_WRITE_STR(pWriter,(*begin).name);
                        if(begin->community.Length()> 0) NLITE_ATTRIBUTE_WRITE_STR(pWriter,(*begin).community);
                        NLITE_ATTRIBUTE_WRITE_INT(pWriter,(*begin).time);
                        if(begin->bgcolor != ListenerData::INIT_COLOR)NLITE_ATTRIBUTE_WRITE_INT(pWriter,(*begin).bgcolor);
+                       if(begin->nameColor != ListenerData::INIT_COLOR)NLITE_ATTRIBUTE_WRITE_INT(pWriter,(*begin).nameColor);
                        pWriter->WriteString(begin->user_id);
                        pWriter->WriteEndElement();
                }
@@ -424,6 +431,7 @@ ReadUserSettingXML::ReadUserSettingXML(CListenerList &in_listenerList):m_listene
                                NLITE_READ_USER_STRING(papszAttrs,listenerBuff,name);
                                NLITE_READ_USER_STRING(papszAttrs,listenerBuff,community);
                                NLITE_READ_USER_INT(papszAttrs,listenerBuff,bgcolor);
+                               NLITE_READ_USER_INT(papszAttrs,listenerBuff,nameColor);
                                NLITE_READ_USER_INT(papszAttrs,listenerBuff,time);
                                
                        }
@@ -453,7 +461,6 @@ ReadUserSettingXML::ReadUserSettingXML(CListenerList &in_listenerList):m_listene
 
                        
                        if(_tcstol(listenerBuff.user_id,NULL,10) != 0 || ((difftime(time(NULL),604800)) <listenerBuff.time)){
-                               listenerBuff.writePropertyFlag = TRUE;
                                listenerBuff.user_id.Append(pszData,nLength);
                        }