- Timestamp:
- 2006-03-31T07:12:27Z (19 years ago)
- Branches:
- master
- Children:
- 755ae5b
- Parents:
- a014331
- Location:
- protocols
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber.c
ra014331 r192b80a 1885 1885 } 1886 1886 1887 static void jabber_set_idle(struct gaim_connection *gc, int idle) {1888 struct jabber_data *jd = (struct jabber_data *)gc->proto_data;1889 jd->idle = idle ? time(NULL) - idle : idle;1890 }1891 1892 1887 static void jabber_keepalive(struct gaim_connection *gc) { 1893 1888 struct jabber_data *jd = (struct jabber_data *)gc->proto_data; 1894 1889 gjab_send_raw(jd->gjc, " \t "); 1895 }1896 1897 static void jabber_buddy_free(struct buddy *b)1898 {1899 while (b->proto_data) {1900 g_free(((GSList *)b->proto_data)->data);1901 b->proto_data = g_slist_remove(b->proto_data, ((GSList *)b->proto_data)->data);1902 }1903 1890 } 1904 1891 … … 2338 2325 } 2339 2326 2340 2341 static GList *jabber_actions()2342 {2343 GList *m = NULL;2344 2345 m = g_list_append(m, _("Set User Info"));2346 /*2347 m = g_list_append(m, _("Set Dir Info"));2348 m = g_list_append(m, _("Change Password"));2349 */2350 2351 return m;2352 }2353 2354 2355 2327 void jabber_init() 2356 2328 { 2357 2329 struct prpl *ret = g_new0(struct prpl, 1); 2358 2330 2359 /* the NULL's aren't required but they're nice to have */2360 2331 ret->name = "jabber"; 2361 2332 ret->away_states = jabber_away_states; 2362 ret->actions = jabber_actions;2363 2333 ret->login = jabber_login; 2364 2334 ret->close = jabber_close; … … 2368 2338 ret->set_away = jabber_set_away; 2369 2339 ret->get_away = jabber_get_away_msg; 2370 ret->set_idle = jabber_set_idle;2371 2340 ret->add_buddy = jabber_add_buddy; 2372 2341 ret->remove_buddy = jabber_remove_buddy; 2373 ret->add_permit = NULL;2374 ret->add_deny = NULL;2375 ret->rem_permit = NULL;2376 ret->rem_deny = NULL;2377 ret->set_permit_deny = NULL;2378 2342 ret->keepalive = jabber_keepalive; 2379 ret->buddy_free = jabber_buddy_free;2380 2343 ret->alias_buddy = jabber_roster_update; 2381 2344 ret->group_buddy = jabber_group_change; -
protocols/nogaim.h
ra014331 r192b80a 69 69 70 70 /* ok. now the fun begins. first we create a connection structure */ 71 struct gaim_connection { 72 /* we need to do either oscar or TOC */ 73 /* we make this as an int in case if we want to add more protocols later */ 71 struct gaim_connection 72 { 74 73 struct prpl *prpl; 75 74 guint32 flags; 76 75 76 /* each connection then can have its own protocol-specific data */ 77 void *proto_data; 78 77 79 /* all connections need an input watcher */ 78 80 int inpa; 81 guint keepalive; 79 82 80 83 /* buddy list stuff. there is still a global groups for the buddy list, but … … 84 87 int permdeny; 85 88 86 /* all connections need a list of chats, even if they don't have chat */87 GSList *buddy_chats;88 89 /* each connection then can have its own protocol-specific data */90 void *proto_data;91 92 89 struct aim_user *user; 93 90 … … 95 92 char displayname[128]; 96 93 char password[32]; 97 guint keepalive;98 /* stuff needed for per-connection idle times */99 guint idle_timer;100 time_t login_time;101 time_t lastsent;102 int is_idle;103 94 104 95 char *away; 105 int is_auto_away;106 96 107 97 int evil; … … 110 100 /* BitlBee */ 111 101 irc_t *irc; 112 int lstitems; /* added for msnP8 */113 102 114 103 struct conversation *conversations; … … 164 153 const char *name; 165 154 166 /* for ICQ and Yahoo, who have off/on per-conversation options */167 /* char *checkbox; this should be per-connection */168 169 GList *(* away_states)(struct gaim_connection *gc);170 GList *(* actions)();171 void (* do_action)(struct gaim_connection *, char *);172 /* user_opts returns a GList* of g_malloc'd struct proto_user_opts */173 GList *(* user_opts)();174 GList *(* chat_info)(struct gaim_connection *);175 176 /* all the server-related functions */177 178 /* a lot of these (like get_dir) are protocol-dependent and should be removed. ones like179 * set_dir (which is also protocol-dependent) can stay though because there's a dialog180 * (i.e. the prpl says you can set your dir info, the ui shows a dialog and needs to call181 * set_dir in order to set it) */182 183 155 void (* login) (struct aim_user *); 156 void (* keepalive) (struct gaim_connection *); 184 157 void (* close) (struct gaim_connection *); 158 185 159 int (* send_im) (struct gaim_connection *, char *who, char *message, int len, int away); 186 int (* send_typing) (struct gaim_connection *, char *who, int typing);187 void (* set_info) (struct gaim_connection *, char *info);188 void (* get_info) (struct gaim_connection *, char *who);189 160 void (* set_away) (struct gaim_connection *, char *state, char *message); 190 161 void (* get_away) (struct gaim_connection *, char *who); 191 void (* set_idle) (struct gaim_connection *, int idletime); 162 int (* send_typing) (struct gaim_connection *, char *who, int typing); 163 192 164 void (* add_buddy) (struct gaim_connection *, char *name); 165 void (* group_buddy) (struct gaim_connection *, char *who, char *old_group, char *new_group); 193 166 void (* remove_buddy) (struct gaim_connection *, char *name, char *group); 194 167 void (* add_permit) (struct gaim_connection *, char *name); … … 197 170 void (* rem_deny) (struct gaim_connection *, char *name); 198 171 void (* set_permit_deny)(struct gaim_connection *); 172 173 void (* set_info) (struct gaim_connection *, char *info); 174 void (* get_info) (struct gaim_connection *, char *who); 175 void (* alias_buddy) (struct gaim_connection *, char *who); /* save/store buddy's alias on server list/roster */ 176 177 /* Group chat stuff. */ 199 178 void (* join_chat) (struct gaim_connection *, GList *data); 200 179 void (* chat_invite) (struct gaim_connection *, int id, char *who, char *message); 201 180 void (* chat_leave) (struct gaim_connection *, int id); 202 void (* chat_whisper) (struct gaim_connection *, int id, char *who, char *message);203 181 int (* chat_send) (struct gaim_connection *, int id, char *message); 204 182 int (* chat_open) (struct gaim_connection *, char *who); 205 void (* keepalive) (struct gaim_connection *); 206 207 /* get "chat buddy" info and away message */ 208 void (* get_cb_info) (struct gaim_connection *, int, char *who); 209 void (* get_cb_away) (struct gaim_connection *, int, char *who); 210 211 /* save/store buddy's alias on server list/roster */ 212 void (* alias_buddy) (struct gaim_connection *, char *who); 213 214 /* change a buddy's group on a server list/roster */ 215 void (* group_buddy) (struct gaim_connection *, char *who, char *old_group, char *new_group); 216 217 void (* buddy_free) (struct buddy *); 218 183 184 /* DIE! */ 219 185 char *(* get_status_string) (struct gaim_connection *gc, int stat); 220 186 187 GList *(* away_states)(struct gaim_connection *gc); 188 189 /* Mainly for AOL, since they think "Bung hole" == "Bu ngho le". *sigh* */ 221 190 int (* cmp_buddynames) (const char *who1, const char *who2); 222 191 }; … … 307 276 struct conversation *conv_findchannel( char *channel ); 308 277 309 310 278 #endif -
protocols/yahoo/yahoo.c
ra014331 r192b80a 227 227 else if( g_strcasecmp( state, GAIM_AWAY_CUSTOM ) == 0 ) 228 228 { 229 if (gc->is_idle) 230 yd->current_status = YAHOO_STATUS_IDLE; 231 else 232 yd->current_status = YAHOO_STATUS_AVAILABLE; 229 yd->current_status = YAHOO_STATUS_AVAILABLE; 233 230 234 231 gc->away = NULL; 235 232 } 236 233 } 237 else if( gc->is_idle )238 yd->current_status = YAHOO_STATUS_IDLE;239 234 else 240 235 yd->current_status = YAHOO_STATUS_AVAILABLE;
Note: See TracChangeset
for help on using the changeset viewer.