view src/server.h @ 9584:fe35f55ee984

[gaim-migrate @ 10427] " When joining a jabber conference many jabber servers send a recap of the last 20 or so messages. If you have sounds enabled, this will result in either 20 sounds in row, or worse if mixing is available, a horrible mix of 20 overlapping sounds. These recap messages can be identifed be the presence of the "jabber:x:delay". This patch identifies delayed messages, passes that information through flags from the prpl to the core, and then on to the gui. Detailed changes: Add GAIM_MESSAGE_DELAYED to GaimMessageFlags to indicate a delayed message. Change gtkconv.c to not play sounds when either GAIM_MESSAGE_DELAYED or GAIM_MESSAGE_SYSTEM are set. Add GaimConvChatFlags, parallel to GaimConvImFlags, to pass flags from protocols to core. Currently contains two flags: GAIM_CONV_CHAT_WHISPER GAIM_CONV_CHAT_DELAYED Change fourth arg of serv_got_chat_in() from "int whisper" to "GaimConvChatFlags chatflags". Change jabber prpl to set delayed flag when the "jabber:x:delay" element is present. Change toc protocol since it uses the whisper flag." --Nathan Fredrickson Date: 2004-07-24 00:49 Sender: marv_sfAccepting Donations Logged In: YES user_id=790708 I'm not sure I like naming the flags "DELAYED". I mean that's okay inside jabber since that's what the jabber protocol refers to it as, but for the the GAIM_*_DELAYED flags, I think they should be named something else. I thought about NOSOUND, but I decided that was wrong, because the flag should say what kind of message it is, not what to do with it, that's up to the UI to decide. What's up with not playing sounds on GAIM_MESSAGE_SYSTEM? This sounds unrelated to this. Are there times when we want to play sounds on system messages? Date: 2004-07-24 09:13 Sender: noif Logged In: YES user_id=365548 I purposely did not use a name that implied what the UI should do with the flag. The only characteristic that makes these messages unique is that they've been stored in the server for some period of time and are not current. I'm open to a better flag name than "DELAYED"... I thought about "RECAP", but that seemed less generalized than "DELAYED". As for not playing sounds on GAIM_MESSAGE_SYSTEM, that can be removed if it's controversial. I think I slipped that in since the setting of the topic was still playing a sound every time you joined a jabber conference. I think we can change the flag name ourselves if something else is better. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sat, 24 Jul 2004 15:18:32 +0000
parents d27156c9c876
children 78022bad9367
line wrap: on
line source

/**
 * @file server.h Server API
 * @ingroup core
 *
 * gaim
 *
 * Gaim is the legal property of its developers, whose names are too numerous
 * to list here.  Please refer to the COPYRIGHT file distributed with this
 * source distribution.
 *
 * This program 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 2 of the License, or
 * (at your option) any later version.
 *
 * This program 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 this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#ifndef _GAIM_SERVER_H_
#define _GAIM_SERVER_H_

/*
 * Really user states are controlled by the PRPLs now. We just
 * use this for event_away
 */
#define UC_UNAVAILABLE  1

#include "account.h"
#include "conversation.h"

#ifdef __cplusplus
extern "C" {
#endif

void serv_login(GaimAccount *);
void serv_close(GaimConnection *);
void serv_touch_idle(GaimConnection *);
int  serv_send_im(GaimConnection *, const char *, const char *, GaimConvImFlags);
void serv_get_info(GaimConnection *, const char *);
void serv_get_dir(GaimConnection *, const char *);
void serv_set_idle(GaimConnection *, int);
void serv_set_info(GaimConnection *, const char *);
void serv_set_away(GaimConnection *, const char *, const char *);
void serv_set_away_all(const char *);
int  serv_send_typing(GaimConnection *, const char *, int);
void serv_change_passwd(GaimConnection *, const char *, const char *);
void serv_add_buddy(GaimConnection *, GaimBuddy *);
void serv_add_buddies(GaimConnection *, GList *);
void serv_remove_buddy(GaimConnection *, GaimBuddy *, GaimGroup *);
void serv_remove_buddies(GaimConnection *, GList *, GList *);
void serv_remove_group(GaimConnection *, GaimGroup *);
void serv_move_buddy(GaimBuddy *, GaimGroup *, GaimGroup *);
void serv_rename_group(GaimConnection *, const char *, GaimGroup *, GList *);
void serv_add_permit(GaimConnection *, const char *);
void serv_add_deny(GaimConnection *, const char *);
void serv_rem_permit(GaimConnection *, const char *);
void serv_rem_deny(GaimConnection *, const char *);
void serv_set_permit_deny(GaimConnection *);
void serv_warn(GaimConnection *, const char *, int);
void serv_set_dir(GaimConnection *, const char *, const char *,
				  const char *, const char *, const char *,
				  const char *, const char *, int);
void serv_dir_search(GaimConnection *, const char *, const char *,
					 const char *, const char *, const char *, const char *,
					 const char *, const char *);
void serv_join_chat(GaimConnection *, GHashTable *);
void serv_reject_chat(GaimConnection *, GHashTable *);
void serv_chat_invite(GaimConnection *, int, const char *, const char *);
void serv_chat_leave(GaimConnection *, int);
void serv_chat_whisper(GaimConnection *, int, const char *, const char *);
int  serv_chat_send(GaimConnection *, int, const char *);
void serv_alias_buddy(GaimBuddy *);
void serv_got_alias(GaimConnection *gc, const char *who, const char *alias);
void serv_got_eviled(GaimConnection *gc, const char *name, int lev);
void serv_got_typing(GaimConnection *gc, const char *name, int timeout,
					 GaimTypingState state);
void serv_set_buddyicon(GaimConnection *gc, const char *filename);
void serv_got_typing_stopped(GaimConnection *gc, const char *name);
void serv_got_im(GaimConnection *gc, const char *who, const char *msg,
				 GaimConvImFlags imflags, time_t mtime);
void serv_got_update(GaimConnection *gc, const char *name, int loggedin,
					 int evil, time_t signon, time_t idle, int type);
void serv_finish_login(GaimConnection *gc);
void serv_got_chat_invite(GaimConnection *gc, const char *name,
						  const char *who, const char *message,
						  GHashTable *data);
GaimConversation *serv_got_joined_chat(GaimConnection *gc,
									   int id, const char *name);
void serv_got_chat_left(GaimConnection *g, int id);
void serv_got_chat_in(GaimConnection *g, int id, const char *who,
					  GaimConvChatFlags chatflags, const char *message, time_t mtime);
void serv_send_file(GaimConnection *gc, const char *who, const char *file);

#ifdef __cplusplus
}
#endif

#endif /* _GAIM_SERVER_H_ */