{"action":"created","comment":{"url":"https://api.github.com/repos/ethereum/alethzero/pulls/comments/40660206","id":40660206,"diff_hunk":"@@ -66,85 +66,260 @@ QString messageToString(shh::Envelope const& _e, shh::Message const& _m)\n \n WhisperPeers::WhisperPeers(ZeroFace* _m):\n \tPlugin(_m, \"WhisperPeers\"),\n-\tm_ui(new Ui::WhisperPeers)\n+\tm_ui(new Ui::WhisperPeers),\n+\tm_stopped(false)\n {\n \tdock(Qt::RightDockWidgetArea, \"Active Whispers\")->setWidget(new QWidget);\n \tm_ui->setupUi(dock()->widget());\n-\tstartTimer(1000);\n \tsetDefaultTopics();\n+\tconnect(m_ui->stop, SIGNAL(clicked()), this, SLOT(onStopClicked()));\n+\tconnect(m_ui->clear, SIGNAL(clicked()), this, SLOT(onClearClicked()));\n+\tconnect(m_ui->forgetCurrent, SIGNAL(clicked()), this, SLOT(onForgetCurrentTopicClicked()));\n+\tconnect(m_ui->forgetAll, SIGNAL(clicked()), this, SLOT(onForgetAllClicked()));\n+\tconnect(m_ui->topics, SIGNAL(currentIndexChanged(QString)), this, SLOT(onFilterChanged()));\n+\tm_ui->forgetCurrent->setEnabled(false);\n+\tm_ui->whispers->setAlternatingRowColors(true);\n+\tm_ui->whispers->setStyleSheet(\"alternate-background-color: aquamarine;\");\n+\tm_ui->whispers->setWordWrap(true);\n+\tstartTimer(1000);\n+}\n+\n+WhisperPeers::~WhisperPeers()\n+{\n+\tonForgetAllClicked();\n }\n \n void WhisperPeers::setDefaultTopics()\n {\n-\tm_ui->topics->addItem(c_filterToMe);\n \tm_ui->topics->addItem(c_filterAll);\n-\tm_ui->topics->addItem(c_filterDecrypted);\n }\n \n-void WhisperPeers::noteTopic(QString const _topic)\n+bool WhisperPeers::isCurrentTopicAll()\n+{\n+\tQString const topic = m_ui->topics->currentText();\n+\treturn !topic.compare(c_filterAll);\n+}\n+\n+void WhisperPeers::noteTopic(QString const& _topic)\n {\n-\tm_ui->topics->addItem(_topic);\n-\tm_knownTopics.insert(_topic);\n+\tif (m_ui->topics->findText(_topic) < 0)\n+\t{\n+\t\tm_ui->topics->addItem(_topic);\n+\n+\t\tif (m_topics.find(_topic) == m_topics.end())\n+\t\t{\n+\t\t\tshh::BuildTopic bt(_topic.toStdString());\n+\t\t\tunsigned f = web3()->whisper()->installWatch(bt);\n+\t\t\tm_topics[_topic] = f;\n+\t\t}\n+\t}\n }\n \n-void WhisperPeers::forgetTopics()\n+void WhisperPeers::onForgetAllClicked()\n {\n-\tm_knownTopics.clear();\n \tm_ui->topics->clear();\n \tsetDefaultTopics();\n+\n+\tm_chatLock.lock();","path":"alethzero/plugins/whisper/WhisperPeers.cpp","position":107,"original_position":107,"commit_id":"de15ca7929526f5f0f2da4f880e0bf8bca367cc1","original_commit_id":"de15ca7929526f5f0f2da4f880e0bf8bca367cc1","user":{"login":"arkpar","id":9008569,"avatar_url":"https://avatars.githubusercontent.com/u/9008569?v=3","gravatar_id":"","url":"https://api.github.com/users/arkpar","html_url":"https://github.com/arkpar","followers_url":"https://api.github.com/users/arkpar/followers","following_url":"https://api.github.com/users/arkpar/following{/other_user}","gists_url":"https://api.github.com/users/arkpar/gists{/gist_id}","starred_url":"https://api.github.com/users/arkpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arkpar/subscriptions","organizations_url":"https://api.github.com/users/arkpar/orgs","repos_url":"https://api.github.com/users/arkpar/repos","events_url":"https://api.github.com/users/arkpar/events{/privacy}","received_events_url":"https://api.github.com/users/arkpar/received_events","type":"User","site_admin":false},"body":"Use guards for mutex locking here and below","created_at":"2015-09-29T11:30:55Z","updated_at":"2015-09-29T11:30:55Z","html_url":"https://github.com/ethereum/alethzero/pull/72#discussion_r40660206","pull_request_url":"https://api.github.com/repos/ethereum/alethzero/pulls/72","_links":{"self":{"href":"https://api.github.com/repos/ethereum/alethzero/pulls/comments/40660206"},"html":{"href":"https://github.com/ethereum/alethzero/pull/72#discussion_r40660206"},"pull_request":{"href":"https://api.github.com/repos/ethereum/alethzero/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/ethereum/alethzero/pulls/72","id":46105254,"html_url":"https://github.com/ethereum/alethzero/pull/72","diff_url":"https://github.com/ethereum/alethzero/pull/72.diff","patch_url":"https://github.com/ethereum/alethzero/pull/72.patch","issue_url":"https://api.github.com/repos/ethereum/alethzero/issues/72","number":72,"state":"open","locked":false,"title":"whisper plugin complete","user":{"login":"gluk256","id":9915581,"avatar_url":"https://avatars.githubusercontent.com/u/9915581?v=3","gravatar_id":"","url":"https://api.github.com/users/gluk256","html_url":"https://github.com/gluk256","followers_url":"https://api.github.com/users/gluk256/followers","following_url":"https://api.github.com/users/gluk256/following{/other_user}","gists_url":"https://api.github.com/users/gluk256/gists{/gist_id}","starred_url":"https://api.github.com/users/gluk256/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gluk256/subscriptions","organizations_url":"https://api.github.com/users/gluk256/orgs","repos_url":"https://api.github.com/users/gluk256/repos","events_url":"https://api.github.com/users/gluk256/events{/privacy}","received_events_url":"https://api.github.com/users/gluk256/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-27T17:52:05Z","updated_at":"2015-09-29T11:30:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9d15388a96a76e2c32296f094a192242b13be9f9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ethereum/alethzero/pulls/72/commits","review_comments_url":"https://api.github.com/repos/ethereum/alethzero/pulls/72/comments","review_comment_url":"https://api.github.com/repos/ethereum/alethzero/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ethereum/alethzero/issues/72/comments","statuses_url":"https://api.github.com/repos/ethereum/alethzero/statuses/de15ca7929526f5f0f2da4f880e0bf8bca367cc1","head":{"label":"gluk256:_appearence","ref":"_appearence","sha":"de15ca7929526f5f0f2da4f880e0bf8bca367cc1","user":{"login":"gluk256","id":9915581,"avatar_url":"https://avatars.githubusercontent.com/u/9915581?v=3","gravatar_id":"","url":"https://api.github.com/users/gluk256","html_url":"https://github.com/gluk256","followers_url":"https://api.github.com/users/gluk256/followers","following_url":"https://api.github.com/users/gluk256/following{/other_user}","gists_url":"https://api.github.com/users/gluk256/gists{/gist_id}","starred_url":"https://api.github.com/users/gluk256/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gluk256/subscriptions","organizations_url":"https://api.github.com/users/gluk256/orgs","repos_url":"https://api.github.com/users/gluk256/repos","events_url":"https://api.github.com/users/gluk256/events{/privacy}","received_events_url":"https://api.github.com/users/gluk256/received_events","type":"User","site_admin":false},"repo":{"id":41435614,"name":"alethzero","full_name":"gluk256/alethzero","owner":{"login":"gluk256","id":9915581,"avatar_url":"https://avatars.githubusercontent.com/u/9915581?v=3","gravatar_id":"","url":"https://api.github.com/users/gluk256","html_url":"https://github.com/gluk256","followers_url":"https://api.github.com/users/gluk256/followers","following_url":"https://api.github.com/users/gluk256/following{/other_user}","gists_url":"https://api.github.com/users/gluk256/gists{/gist_id}","starred_url":"https://api.github.com/users/gluk256/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gluk256/subscriptions","organizations_url":"https://api.github.com/users/gluk256/orgs","repos_url":"https://api.github.com/users/gluk256/repos","events_url":"https://api.github.com/users/gluk256/events{/privacy}","received_events_url":"https://api.github.com/users/gluk256/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gluk256/alethzero","description":"The AlethZero Hardcore Ethereum Client","fork":true,"url":"https://api.github.com/repos/gluk256/alethzero","forks_url":"https://api.github.com/repos/gluk256/alethzero/forks","keys_url":"https://api.github.com/repos/gluk256/alethzero/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gluk256/alethzero/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gluk256/alethzero/teams","hooks_url":"https://api.github.com/repos/gluk256/alethzero/hooks","issue_events_url":"https://api.github.com/repos/gluk256/alethzero/issues/events{/number}","events_url":"https://api.github.com/repos/gluk256/alethzero/events","assignees_url":"https://api.github.com/repos/gluk256/alethzero/assignees{/user}","branches_url":"https://api.github.com/repos/gluk256/alethzero/branches{/branch}","tags_url":"https://api.github.com/repos/gluk256/alethzero/tags","blobs_url":"https://api.github.com/repos/gluk256/alethzero/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gluk256/alethzero/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gluk256/alethzero/git/refs{/sha}","trees_url":"https://api.github.com/repos/gluk256/alethzero/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gluk256/alethzero/statuses/{sha}","languages_url":"https://api.github.com/repos/gluk256/alethzero/languages","stargazers_url":"https://api.github.com/repos/gluk256/alethzero/stargazers","contributors_url":"https://api.github.com/repos/gluk256/alethzero/contributors","subscribers_url":"https://api.github.com/repos/gluk256/alethzero/subscribers","subscription_url":"https://api.github.com/repos/gluk256/alethzero/subscription","commits_url":"https://api.github.com/repos/gluk256/alethzero/commits{/sha}","git_commits_url":"https://api.github.com/repos/gluk256/alethzero/git/commits{/sha}","comments_url":"https://api.github.com/repos/gluk256/alethzero/comments{/number}","issue_comment_url":"https://api.github.com/repos/gluk256/alethzero/issues/comments{/number}","contents_url":"https://api.github.com/repos/gluk256/alethzero/contents/{+path}","compare_url":"https://api.github.com/repos/gluk256/alethzero/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gluk256/alethzero/merges","archive_url":"https://api.github.com/repos/gluk256/alethzero/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gluk256/alethzero/downloads","issues_url":"https://api.github.com/repos/gluk256/alethzero/issues{/number}","pulls_url":"https://api.github.com/repos/gluk256/alethzero/pulls{/number}","milestones_url":"https://api.github.com/repos/gluk256/alethzero/milestones{/number}","notifications_url":"https://api.github.com/repos/gluk256/alethzero/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gluk256/alethzero/labels{/name}","releases_url":"https://api.github.com/repos/gluk256/alethzero/releases{/id}","created_at":"2015-08-26T16:06:12Z","updated_at":"2015-08-26T16:06:12Z","pushed_at":"2015-09-29T10:27:05Z","git_url":"git://github.com/gluk256/alethzero.git","ssh_url":"git@github.com:gluk256/alethzero.git","clone_url":"https://github.com/gluk256/alethzero.git","svn_url":"https://github.com/gluk256/alethzero","homepage":null,"size":1215,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"ethereum:develop","ref":"develop","sha":"aeabd3baa60d28ec54586c3df838fdeb6549867e","user":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"repo":{"id":40890707,"name":"alethzero","full_name":"ethereum/alethzero","owner":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ethereum/alethzero","description":"The AlethZero Hardcore Ethereum Client","fork":false,"url":"https://api.github.com/repos/ethereum/alethzero","forks_url":"https://api.github.com/repos/ethereum/alethzero/forks","keys_url":"https://api.github.com/repos/ethereum/alethzero/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethereum/alethzero/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethereum/alethzero/teams","hooks_url":"https://api.github.com/repos/ethereum/alethzero/hooks","issue_events_url":"https://api.github.com/repos/ethereum/alethzero/issues/events{/number}","events_url":"https://api.github.com/repos/ethereum/alethzero/events","assignees_url":"https://api.github.com/repos/ethereum/alethzero/assignees{/user}","branches_url":"https://api.github.com/repos/ethereum/alethzero/branches{/branch}","tags_url":"https://api.github.com/repos/ethereum/alethzero/tags","blobs_url":"https://api.github.com/repos/ethereum/alethzero/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethereum/alethzero/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethereum/alethzero/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethereum/alethzero/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethereum/alethzero/statuses/{sha}","languages_url":"https://api.github.com/repos/ethereum/alethzero/languages","stargazers_url":"https://api.github.com/repos/ethereum/alethzero/stargazers","contributors_url":"https://api.github.com/repos/ethereum/alethzero/contributors","subscribers_url":"https://api.github.com/repos/ethereum/alethzero/subscribers","subscription_url":"https://api.github.com/repos/ethereum/alethzero/subscription","commits_url":"https://api.github.com/repos/ethereum/alethzero/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethereum/alethzero/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethereum/alethzero/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethereum/alethzero/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethereum/alethzero/contents/{+path}","compare_url":"https://api.github.com/repos/ethereum/alethzero/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethereum/alethzero/merges","archive_url":"https://api.github.com/repos/ethereum/alethzero/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethereum/alethzero/downloads","issues_url":"https://api.github.com/repos/ethereum/alethzero/issues{/number}","pulls_url":"https://api.github.com/repos/ethereum/alethzero/pulls{/number}","milestones_url":"https://api.github.com/repos/ethereum/alethzero/milestones{/number}","notifications_url":"https://api.github.com/repos/ethereum/alethzero/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethereum/alethzero/labels{/name}","releases_url":"https://api.github.com/repos/ethereum/alethzero/releases{/id}","created_at":"2015-08-17T11:54:33Z","updated_at":"2015-09-28T09:50:46Z","pushed_at":"2015-09-29T10:27:06Z","git_url":"git://github.com/ethereum/alethzero.git","ssh_url":"git@github.com:ethereum/alethzero.git","clone_url":"https://github.com/ethereum/alethzero.git","svn_url":"https://github.com/ethereum/alethzero","homepage":null,"size":1747,"stargazers_count":4,"watchers_count":4,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":15,"forks":9,"open_issues":15,"watchers":4,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ethereum/alethzero/pulls/72"},"html":{"href":"https://github.com/ethereum/alethzero/pull/72"},"issue":{"href":"https://api.github.com/repos/ethereum/alethzero/issues/72"},"comments":{"href":"https://api.github.com/repos/ethereum/alethzero/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/ethereum/alethzero/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/ethereum/alethzero/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ethereum/alethzero/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/ethereum/alethzero/statuses/de15ca7929526f5f0f2da4f880e0bf8bca367cc1"}}}}