Changeset 30 in chevmsgr
- Timestamp:
- 11/30/15 20:51:27 (9 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/msgsrv.cpp
r25 r30 115 115 "(" 116 116 " id TEXT NOT NULL," 117 " friend TEXT NOT NULL" 117 " friend TEXT NOT NULL," 118 " unique (friend)" 118 119 ")"; 119 120 -
trunk/msvc14/ChevMsgrClient_MFC/AddGroupChat.cpp
r29 r30 41 41 42 42 for (size_t iter = 0; iter < mMsgrClntDlg->idList.size(); iter++) 43 {44 43 mFriendListToChat.InsertString(iter, str2cstr(mMsgrClntDlg->idList[iter].id)); 45 }46 44 47 45 return TRUE; -
trunk/msvc14/ChevMsgrClient_MFC/ChevMsgrClient_MFCDlg.cpp
r29 r30 8 8 #include "afxdialogex.h" 9 9 #include <fstream> 10 #include <algorithm> 10 11 11 12 #include "LoginDlg.h" … … 214 215 int cb_listen(SConversation & chat) 215 216 { 216 CString cstr; 217 218 if (gDlg->mFriendListBox.GetCurSel() >= 0) 219 { 220 gDlg->mFriendListBox.GetText(gDlg->mFriendListBox.GetCurSel(), cstr); 221 222 if (cstr2str(cstr) == chat.from) 217 int idx = -1; 218 219 for (idx = 0; idx < gDlg->mFriendListBox.GetCount(); idx++) 220 { 221 if (chat.sessid == gDlg->scl[idx].sessionId) 223 222 { 224 gDlg->mChatListBox.InsertString(gDlg->mChatListBox.GetCount(), str2cstr("<" + chat.from + ">")); 225 gDlg->mChatListBox.InsertString(gDlg->mChatListBox.GetCount(), str2cstr(chat.message)); 226 gDlg->mChatListBox.InsertString(gDlg->mChatListBox.GetCount(), _T("")); 227 } 228 } 229 230 for (int iter = 0; iter < gDlg->mFriendListBox.GetCount(); iter++) 231 { 232 gDlg->mFriendListBox.GetText(iter, cstr); 233 234 if (cstr2str(cstr) == chat.from) 235 { 236 gDlg->scl[iter].chatList.push_back(chat); 223 gDlg->scl[idx].chatList.push_back(chat); 237 224 break; 238 225 } 239 226 } 240 227 228 if (gDlg->mFriendListBox.GetCurSel() == idx) 229 { 230 gDlg->mChatListBox.InsertString(gDlg->mChatListBox.GetCount(), str2cstr("<" + chat.from + ">")); 231 gDlg->mChatListBox.InsertString(gDlg->mChatListBox.GetCount(), str2cstr(chat.message)); 232 gDlg->mChatListBox.InsertString(gDlg->mChatListBox.GetCount(), _T("")); 233 } 234 241 235 return 0; 242 236 } … … 244 238 int cb_opensession(SOpenSession & opensession) 245 239 { 240 if (opensession.idList.size() == 2) 241 return 0; 242 243 CString cstrIdList = _T(""); 244 245 for (size_t iter = 0; iter < opensession.idList.size(); iter++) 246 { 247 if (opensession.idList[iter] != gDlg->mId) 248 { 249 if (cstrIdList == "") 250 cstrIdList = str2cstr(opensession.idList[iter]); 251 else 252 cstrIdList = cstrIdList + "," + str2cstr(opensession.idList[iter]); 253 } 254 } 255 256 gDlg->mFriendListBox.InsertString(gDlg->mFriendListBox.GetCount(), cstrIdList); 257 258 Session s; 259 s.sessionId = opensession.sessid; 260 261 gDlg->scl.push_back(s); 262 246 263 return 0; 247 264 } … … 265 282 { 266 283 std::vector<std::string> idList; 267 //FIXME : ,·Î ÆĽÌÇϱâ! testÄÚµå Âü°íÇÒ°Í 268 idList.push_back(cstr2str(receiver)); 284 std::string comma; 285 mFriendListBox.GetText(idx, receiver); 286 std::istringstream is(cstr2str(receiver)); 287 while (std::getline(is, comma, ',')) 288 idList.push_back(comma); 289 std::sort(idList.begin(), idList.end()); 269 290 scl[idx].sessionId = chev.getSessionID(idList); 270 291 } … … 309 330 AGCDlg.DoModal(); 310 331 332 CString cmpCstr; 333 for (int iter = 0; iter < this->mFriendListBox.GetCount(); iter++) 334 { 335 this->mFriendListBox.GetText(iter, cmpCstr); 336 if (AGCDlg.groupChat == cmpCstr) 337 return; 338 } 339 311 340 mFriendListBox.InsertString(mFriendListBox.GetCount(), AGCDlg.groupChat); 312 313 //FIXME : Á¤»óÀûÀ¸·Î push_back µ¿ÀÛÇÏ´ÂÁö Å×½ºÆ® 314 // ÀÌ°Å¿¡ ÀÇÇØ OnLbnSelchangeListFriends¿¡¼ ¾ÈÁ×´ÂÁö È®ÀÎÇϱâ 315 Session s; 316 scl.push_back(s); 341 gDlg->scl.resize(gDlg->scl.size() + 1); 317 342 } 318 343 … … 344 369 return; 345 370 371 // vector out of range error 346 372 if (scl[idx].sessionId == "") 347 373 return;
Note:
See TracChangeset
for help on using the changeset viewer.