Updating ChangeLog for 4.22.10
[centerim.git] / src / hooks / ljhook.h
blob9d0b5235f4a5956158a06be57128b8894a58b85a
1 #ifndef __LJHOOK_H__
2 #define __LJHOOK_H__
4 #include "abstracthook.h"
6 #ifdef BUILD_LJ
8 #include "HTTPClient.h"
10 class ljhook: public abstracthook, public sigslot::has_slots<> {
11 protected:
12 HTTPClient httpcli;
14 string baseurl, md5pass, username;
15 vector<int> rfds, wfds, efds;
16 bool fonline, flogged;
17 imcontact self;
18 time_t timer_getfriends;
20 verticalmenu *sdest;
21 string lookfor;
23 enum RequestType {
24 reqLogin,
25 reqPost,
26 reqPostComment,
27 reqGetFriends,
28 reqDelFriend,
29 reqAddFriend,
30 reqLookup,
31 reqDone
34 map<HTTPRequestEvent *, RequestType> sent;
35 vector<string> friendof, journals, moods, pictures;
37 void socket_cb(SocketEvent *ev);
38 void messageack_cb(MessageEvent *ev);
39 void logger_cb(LogEvent *ev);
41 void requestfriends();
43 string getfeedurl(const string &nick) const;
44 string getoldfeedurl(const string &nick) const;
46 public:
47 ljhook();
48 ~ljhook();
50 void init();
52 void connect();
53 void disconnect();
54 void exectimers();
55 void main();
57 void getsockets(fd_set &rfds, fd_set &wfds, fd_set &efds, int &hsocket) const;
58 bool isoursocket(fd_set &rfds, fd_set &wfds, fd_set &efds) const;
60 bool online() const;
61 bool logged() const;
62 bool isconnecting() const;
63 bool enabled() const;
65 bool send(const imevent &sev);
67 void sendnewuser(const imcontact &ic);
68 void removeuser(const imcontact &ic);
70 void setautostatus(imstatus st);
71 imstatus getstatus() const;
73 void requestinfo(const imcontact &c);
75 void lookup(const imsearchparams &params, verticalmenu &dest);
76 void stoplookup();
78 void requestawaymsg(const imcontact &c);
79 void requestversion(const imcontact &c);
80 void ping(const imcontact &c);
82 void ouridchanged(const icqconf::imaccount &ia);
84 void updatecontact(icqcontact *c);
86 vector<string> getjournals() const { return journals; }
87 vector<string> getmoods() const { return moods; }
88 vector<string> getpictures() const { return pictures; }
91 extern ljhook lhook;
93 #endif
95 #endif