# Copyright (C) 2014 cybojenix <anthonydking@slimroms.net>
#
# This file is part of XdaPy.
#
# XdaPy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# XdaPy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with XdaPy.  If not, see <http://www.gnu.org/licenses/>.

from .base import XdaBase


class Threads(XdaBase):
    pass
@@ -725,16 +725,55 @@
 XdaBase%0A
+from .decorators import login_required%0A
 %0A%0Aclass 
@@ -794,12 +794,1654 @@
 e):%0A
+%0A
     
-pass
+def threads(self, forum_id, page=1):%0A        method = %22GET%22%0A        url = %22/v1/threads%22%0A        d = %7B%22forumid%22: forum_id,%0A             %22page%22: page%7D%0A        return self.xda.requests.basic_request(method, url, body=d)%0A%0A    @login_required%0A    def participated(self, page=1):%0A        method = %22GET%22%0A        url = %22/v1/threads/participated%22%0A        d = %7B%22page%22: page%7D%0A        return self.xda.requests.basic_request(method, url, body=d)%0A%0A    @login_required%0A    def subscribed(self, page=1, unread_only=False):%0A        method = %22GET%22%0A        url = %22/v1/threads/subscribed%22%0A        d = %7B%22page%22: page,%0A             %22unread_only%22: unread_only%7D%0A        return self.xda.requests.basic_request(method, url, body=d)%0A%0A    def thread_info(self, thread_id):%0A        method = %22GET%22%0A        url = %22/v1/threads/threadinfo%22%0A        d = %7B%22threadid%22: thread_id%7D%0A        return self.xda.requests.basic_request(method, url, body=d)%0A%0A    @login_required%0A    def new(self, forum_id, title, message):%0A        method = %22POST%22%0A        url = %22/v1/threads/new%22%0A        d = %7B%22forumid%22: forum_id,%0A             %22title%22: title,%0A             %22message%22: message%7D%0A        return self.xda.requests.basic_request(method, url, body=d)%0A%0A    @login_required%0A    def subscribe(self, thread_id):%0A        method = %22POST%22%0A        url = %22/v1/threads/subscribe%22%0A        d = %7B%22threadid%22: thread_id%7D%0A        return self.xda.requests.basic_request(method, url, body=d)%0A%0A    @login_required%0A    def unsubscribe(self, thread_id):%0A        method = %22POST%22%0A        url = %22/v1/threads/unsubscribe%22%0A        d = %7B%22threadid%22: thread_id%7D%0A        return self.xda.requests.basic_request(method, url, body=d)

add threads access points