//\83\8a\83X\83i\81[\8c\9f\8dõ\83I\83u\83W\83F\83N\83g
struct ListenerPre{
- LPCTSTR user_id;
+ ListenerData &user;
- ListenerPre(LPCTSTR user_id_in):
- user_id(user_id_in)
+ ListenerPre(ListenerData &in_user):
+ user(in_user)
{}
bool operator()(CListenerList::reference listenerData){
- return _tcscmp(user_id,listenerData.user_id) == 0;
+
+ return (user.user_id == listenerData.user_id) && (user.community == listenerData.community);
}
};
user_id(TEXT("")),
name(TEXT("")),
community(TEXT("")),
-bgcolor(PALETTERGB(0,0,0)),
-originBkFlag(FALSE),
+bgcolor(INIT_COLOR),
+//originBkFlag(FALSE),
time(0)
{}
height(0)
{}
-VOID CChatData::SetChat(NicoLiveChat &chat_in){
+VOID CChatData::SetChat(NicoLiveChat &chat_in,ListenerData &listener){
this->anonymity = _ttol(chat_in.anonymity);
this->name = chat_in.name;
- this->listenerData = &listenerList.Register(chat_in.user_id);
+
+
+ this->listenerData = &listenerList.Register(listener);
this->vpos = _ttol(chat_in.vpos);
}
-CCommentList::iterator CCommentList::OnChatReceve(NicoLiveChat_P chatData_in, UINT_PTR commnetCountSum,CCommentListWindow &listWindow){
+CCommentList::iterator CCommentList::OnChatReceve(NicoLiveChat_P chatData_in,LPCTSTR communityID, UINT_PTR commnetCountSum,CCommentListWindow &listWindow){
CChatData chatData;
- chatData.SetChat(*chatData_in);
+ ListenerData listenerData;
+ listenerData.user_id = chatData_in->user_id;
+ listenerData.time = time(NULL);
+ listenerData.community = communityID;
+ chatData.SetChat(*chatData_in,listenerData);
iterator rslt;
if(empty() == TRUE || back().date <= chatData.date){
chatList.push_back(chatData);
std::for_each(m_listenerList.begin(), end,target);
}
-CListenerList::reference CListenerList::Register(LPCTSTR user_id){
+CListenerList::reference CListenerList::Register(ListenerData &listener){
- ListenerPre listenerPre(user_id);
+ ListenerPre listenerPre(listener);
iterator begin = m_listenerList.begin();
iterator end = m_listenerList.end();
if(rslt == end){
- ListenerData insertData;
- insertData.user_id = user_id;
- insertData.time = time(NULL);
- m_listenerList.push_back(insertData);
+
+ m_listenerList.push_back(listener);
return m_listenerList.back();
CNLiteString community; //\93o\98^\82µ\82½\83R\83~\83\85\83j\83e\83B
COLORREF bgcolor; //\94w\8ci\90F
time_t time; //\93o\98^\8e\9e\8aÔ
- BOOL originBkFlag; //\94w\8ci\90F\90Ý\92è\83t\83\89\83O
+// BOOL originBkFlag; //\94w\8ci\90F\90Ý\92è\83t\83\89\83O
public:
+
+ enum {
+ INIT_COLOR = -1
+
+ };
///
///\83R\83\93\83X\83g\83\89\83N\83^
//\83t\83@\83\93\83N\83V\83\87\83i\83\8b
void operator()(ListenerData &target){
- if(target.originBkFlag == TRUE){
+ if(target.bgcolor != ListenerData::INIT_COLOR){
colorlist.push_back(target.bgcolor);
}
///
///\83\86\81[\83U\81[\93o\98^
///
- reference Register(LPCTSTR user_id);
+ reference Register(ListenerData &listener);
///
///\94w\8ci\90F\82ð\8eû\8fW\82·\82é
///
///nlib\82Ì\83`\83\83\83b\83g\83f\81[\83^\82ð\83Z\83b\83g
///
- VOID SetChat(NicoLiveChat &chat_in);
+ VOID SetChat(NicoLiveChat &chat_in,ListenerData &listener);
};
///\83\8a\83X\83g\82ª\8bó\82©\81A\8eó\90M\82µ\82½\83`\83\83\83b\83g\83f\81[\83^\82Ìdate\82Ì\92l\82ª\83\8a\83X\83g\8dÅ\8cã\94ö\88È\8fã\82Ì\82à\82Ì\82¾\82Á\82½\8fê\8d\87\8dÅ\8cã\94ö\82É\91}\93ü\82³\82ê\82é
///\82»\82¤\82Å\82È\82©\82Á\82½\8fê\8d\87\82Í\83\8a\83X\83g\82Ì\8dÅ\8f\89\82©\82ç\88ø\90\94\82É\93n\82³\82ê\82½\83`\83\83\83b\83g\83f\81[\83^\82Ìdate\82æ\82è\91å\82«\82¢date\82ð\8e\9d\82Â\83f\81[\83^\82ð\92T\82µ\81A\82»\82Ì\83f\81[\83^\82Ì\92¼\91O\82É\91}\93ü\82·\82é
///
- iterator OnChatReceve(NicoLiveChat_P chatData, UINT_PTR count,CCommentListWindow &listWindow);
+ iterator OnChatReceve(NicoLiveChat_P chatData,LPCTSTR communityID, UINT_PTR count,CCommentListWindow &listWindow);
///
///\8ew\92è\82µ\82½\94Ô\8d\86\82Ì\83R\83\81\83\93\83g\8eQ\8fÆ\82ð\8eæ\93¾
bkColor = comment.viewData.backColor;
- }else if(comment.listenerData->originBkFlag == TRUE){
+ }else if(comment.listenerData->bgcolor != ListenerData::INIT_COLOR){
bkColor = comment.listenerData->bgcolor;
VOID CCommentView::OnChatReceve(NicoLiveChat_P chat,UINT_PTR commnetCountSum){
- commentlist.OnChatReceve(chat,commnetCountSum,this->m_commentListWindow);
+ commentlist.OnChatReceve(chat,stream.GetDefaultCommunity(),commnetCountSum,this->m_commentListWindow);
return;
}
- if(chatData.viewData.backColor != CChatData::ViewData::INIT_COLOR || chatData.listenerData->originBkFlag == TRUE){
+ if(chatData.viewData.backColor != CChatData::ViewData::INIT_COLOR || chatData.listenerData->bgcolor != ListenerData::INIT_COLOR){
if(chatData.viewData.backColor != CChatData::ViewData::INIT_COLOR){
bkColor = chatData.viewData.backColor;
originBkBrush.CreateSolidBrush(chatData.viewData.backColor);
- }else if(chatData.listenerData->originBkFlag == TRUE){
+ }else if(chatData.listenerData->bgcolor != ListenerData::INIT_COLOR){
bkColor = chatData.listenerData->bgcolor;
originBkBrush.CreateSolidBrush(chatData.listenerData->bgcolor);
COLORREF bkColor;
- if(lineIte->listenerData->originBkFlag == FALSE){
+ if(lineIte->listenerData->bgcolor == ListenerData::INIT_COLOR){
CListenerColorCollector colorCollector;
listenerList.BkColorCollect(colorCollector);
UCHAR red;
}while(colorCollector.Find(bkColor));
- lineIte->listenerData->originBkFlag = TRUE;
+
lineIte->listenerData->SetBkColor(bkColor);
} else {
- lineIte->listenerData->originBkFlag = FALSE;
+ lineIte->listenerData->bgcolor = ListenerData::INIT_COLOR;
}
}
::GetPrivateProfileString(sectionName,keyName,TEXT(""),propertyBuf,ARRAY_LENGTH(propertyBuf),iniFile);
if((_tcslen(propertyBuf) == 0) || !((PathFileExists(propertyBuf) && !::PathIsDirectory( propertyBuf )))){
- propertyPath = appLocalPath;
- propertyPath += TEXT("\\qwerty_nico\\nlite\\property.xml");
-
- ::WritePrivateProfileString(sectionName,keyName,propertyPath,iniFile);
+
+ propertyFolderPath = appLocalPath;
+ propertyFolderPath += TEXT("\\qwerty_nico\\nlite");
+
+ ::WritePrivateProfileString(sectionName,keyName,propertyFolderPath,iniFile);
} else {
- propertyPath = propertyBuf;
+ propertyFolderPath = propertyBuf;
}
+ propertyPath = propertyFolderPath;
+ propertyPath += TEXT("\\property.xml");
+ userSettingPath = propertyFolderPath;
+ userSettingPath += TEXT("\\user_setting.xml");
+ SurelyCreate(propertyFolderPath,FALSE);
SurelyCreate(propertyPath,TRUE);
-
+ SurelyCreate(userSettingPath,TRUE);
return;
}
GeneralProperty gp; //\8b¤\97L\83v\83\8d\83p\83e\83B
CommentReadProperty crp; //\83R\83\81\83\93\83g\93Ç\82Ý\8fã\82°\83v\83\8d\83p\83e\83B
CNLiteString appLocalPath; //\83\8d\81[\83J\83\8b\83t\83H\83\8b\83_\83p\83X
- CNLiteString propertyPath; //\83v\83\8d\83p\83e\83B\94z\92u\83t\83H\83\8b\83_\83p\83X
-
+ CNLiteString propertyFolderPath; //\83v\83\8d\83p\83e\83B\94z\92u\83t\83H\83\8b\83_
+ CNLiteString propertyPath; //\83v\83\8d\83p\83e\83B\83t\83@\83C\83\8b\83p\83X
+ CNLiteString userSettingPath; //\83\8a\83X\83i\81[\8fî\95ñ\90Ý\92è\83t\83@\83C\83\8b\83p\83X
Property();
~Property();