source: protocols/twitter/twitter.h @ 3e23850

Last change on this file since 3e23850 was f97b8e9, checked in by Wilmer van der Gaast <wilmer@…>, at 2012-11-25T20:43:52Z

Use hex for show_ids, but stick to the 2-char maximum. a 256-message backlog
really should be enough.

  • Property mode set to 100644
File size: 3.5 KB
RevLine 
[1b221e0]1/***************************************************************************\
2*                                                                           *
3*  BitlBee - An IRC to IM gateway                                           *
4*  Simple module to facilitate twitter functionality.                       *
5*                                                                           *
[96dd574]6*  Copyright 2009-2010 Geert Mulders <g.c.w.m.mulders@gmail.com>            *
7*  Copyright 2010-2012 Wilmer van der Gaast <wilmer@gaast.net>              *
[1b221e0]8*                                                                           *
9*  This library is free software; you can redistribute it and/or            *
10*  modify it under the terms of the GNU Lesser General Public               *
11*  License as published by the Free Software Foundation, version            *
12*  2.1.                                                                     *
13*                                                                           *
14*  This library is distributed in the hope that it will be useful,          *
15*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
16*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        *
17*  Lesser General Public License for more details.                          *
18*                                                                           *
19*  You should have received a copy of the GNU Lesser General Public License *
20*  along with this library; if not, write to the Free Software Foundation,  *
21*  Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA           *
22*                                                                           *
23****************************************************************************/
24
25#include "nogaim.h"
26
27#ifndef _TWITTER_H
28#define _TWITTER_H
29
30#ifdef DEBUG_TWITTER
31#define debug( text... ) imcb_log( ic, text );
32#else
33#define debug( text... )
34#endif
35
[d6aa6dd]36typedef enum
37{
[96dd574]38        TWITTER_HAVE_FRIENDS   = 0x00001,
39        TWITTER_MODE_ONE       = 0x00002,
40        TWITTER_MODE_MANY      = 0x00004,
41        TWITTER_MODE_CHAT      = 0x00008,
[2322a9f]42        TWITTER_DOING_TIMELINE = 0x10000,
[96dd574]43        TWITTER_GOT_TIMELINE   = 0x20000,
44        TWITTER_GOT_MENTIONS   = 0x40000,
[d6aa6dd]45} twitter_flags_t;
46
[ce81acd]47struct twitter_log_data;
48
[1b221e0]49struct twitter_data
50{
51        char* user;
[c42e8b9]52        struct oauth_info *oauth_info;
[2322a9f]53
54        gpointer home_timeline_obj;
55        gpointer mentions_obj;
56
57        guint64 timeline_id;
58
[de923d5]59        GSList *follow_ids;
60       
[7b87539]61        guint64 last_status_id; /* For undo */
[2abceca]62        gint main_loop_id;
[ddc2de5]63        struct http_request *stream;
[2322a9f]64        struct groupchat *timeline_gc;
[3bd4a93]65        gint http_fails;
[d6aa6dd]66        twitter_flags_t flags;
[bb5ce4d1]67       
[de923d5]68        /* set base_url */
[bb5ce4d1]69        gboolean url_ssl;
70        int url_port;
71        char *url_host;
72        char *url_path;
[ffcdf13]73
74        char *prefix; /* Used to generate contact + channel name. */
[ce81acd]75       
[de923d5]76        /* set show_ids */
[ce81acd]77        struct twitter_log_data *log;
78        int log_id;
[1b221e0]79};
80
[203a2d2]81struct twitter_user_data
82{
83        guint64 last_id;
84        time_t last_time;
85};
86
[f97b8e9]87#define TWITTER_LOG_LENGTH 256
[ce81acd]88struct twitter_log_data
89{
90        guint64 id;
[4f50ea5]91        struct bee_user *bu; /* DANGER: can be a dead pointer. Check it first. */
[ce81acd]92};
93
[62d2cfb]94/**
95 * This has the same function as the msn_connections GSList. We use this to
96 * make sure the connection is still alive in callbacks before we do anything
97 * else.
98 */
[9c9a29c]99extern GSList *twitter_connections;
[62d2cfb]100
[d6aa6dd]101void twitter_login_finish( struct im_connection *ic );
102
[6eca2eb]103struct http_request;
104char *twitter_parse_error( struct http_request *req );
105
[96dd574]106void twitter_log(struct im_connection *ic, char *format, ... );
[631ec80]107struct groupchat *twitter_groupchat_init(struct im_connection *ic);
[96dd574]108
[1b221e0]109#endif //_TWITTER_H
Note: See TracBrowser for help on using the repository browser.