OSDN Git Service

非リレー中のチャンネル情報を一括削除できる機能を追加
[peercast-im/PeerCastIM.git] / ui / win32 / simple / gui.cpp
index eac84a7..6a701ef 100644 (file)
@@ -1398,6 +1398,12 @@ void PopupOtherMenu(){
        info.fMask = MIIM_ID | MIIM_TYPE;
        info.fType = MFT_STRING;
 
+       info.wID = 1107;
+       info.dwTypeData = "\94ñ\83\8a\83\8c\81[\92\86\82Ì\83`\83\83\83\93\83l\83\8b\82ð\8dí\8f\9c";
+       InsertMenuItem(hMenu, -1, true, &info);
+
+       InsertMenuItem(hMenu, -1, true, &separator);
+
        if (!gbDispTop){
                info.wID = 1101;
                info.dwTypeData = "\8dÅ\91O\96Ê\95\\8e¦";
@@ -1474,6 +1480,28 @@ void PopupOtherMenu(){
                        servMgr->autoServe = false;
                        break;
 
+               case 1107:  // \94ñ\83\8a\83\8c\81[\92\86\82Ì\83`\83\83\83\93\83l\83\8b\8fî\95ñ\82ð\91S\82Ä\8dí\8f\9c
+                       {
+                               LOG_DEBUG("Start cleaning up unused channels");
+                               while (cd)
+                               {
+                                       if (cd->getStatus() == Channel::S_NOTFOUND
+                                               || cd->getStatus() == Channel::S_IDLE)
+                                       {
+                                               Channel *c = chanMgr->findChannelByChannelID(cd->getChannelId());
+
+                                               if (c && !c->bumped)
+                                               {
+                                                       c->thread.active = false;
+                                                       c->thread.finish = true;
+                                               }
+                                       }
+
+                                       cd = cd->getNextData();
+                               }
+                               LOG_DEBUG("Finish a cleanup of unused channels");
+                       }
+                       break;
        }
 }