[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ayttm-commits] CVS: ayttm/src Makefile.am,1.21,1.22 status.c,1.43,1.44
From: |
Philip S Tellis <address@hidden> |
Subject: |
[Ayttm-commits] CVS: ayttm/src Makefile.am,1.21,1.22 status.c,1.43,1.44 util.c,1.41,1.42 util.h,1.22,1.23 |
Date: |
Thu, 06 Feb 2003 03:52:45 -0500 |
Update of /cvsroot/ayttm/ayttm/src
In directory subversions:/tmp/cvs-serv27796/src
Modified Files:
Makefile.am status.c util.c util.h
Log Message:
linked in offline_queue_mgmt
Index: Makefile.am
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/Makefile.am,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- Makefile.am 3 Feb 2003 11:11:26 -0000 1.21
+++ Makefile.am 6 Feb 2003 08:52:42 -0000 1.22
@@ -10,7 +10,8 @@
trigger.c console_session.c input_list.c nomodule.c \
plugin_api.c plugin.c file_select.c contact_actions.c \
smileys.c help_menu.c crash.c account_parser.y account_scanner.l \
- contact_parser.y contact_scanner.l llist.c mem_util.c
+ contact_parser.y contact_scanner.l llist.c mem_util.c \
+ offline_queue_mgmt.c
noinst_HEADERS = account.h service.h contact.h gtk_globals.h globals.h \
status.h info_window.h chat_window.h util.h add_contact_window.h \
@@ -20,7 +21,7 @@
browser.h input_list.h plugin.h plugin_api.h debug.h \
nomodule.h file_select.h contact_actions.h \
smileys.h intl.h account_parser.h contact_parser.h crash.h \
- externs.h llist.h mem_util.h
+ externs.h llist.h mem_util.h offline_queue_mgmt.h
EXTRA_DIST =
Index: status.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/status.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- status.c 3 Feb 2003 11:11:26 -0000 1.43
+++ status.c 6 Feb 2003 08:52:42 -0000 1.44
@@ -48,6 +48,7 @@
#include "sound.h"
#include "plugin.h"
#include "prefs_window.h"
+#include "offline_queue_mgmt.h"
#include "gtk/gtkutils.h"
#include "gtk/about.h"
Index: util.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/util.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- util.c 5 Feb 2003 07:32:53 -0000 1.41
+++ util.c 6 Feb 2003 08:52:42 -0000 1.42
@@ -55,6 +55,7 @@
#include "plugin.h"
#include "dialog.h"
#include "service.h"
+#include "offline_queue_mgmt.h"
#ifndef NAME_MAX
@@ -1403,225 +1404,6 @@
return newlist;
}
-
-void contact_mgmt_queue_add(eb_account *ea, int action, char *new_group)
-{
- FILE *fp;
- char buff [NAME_MAX];
- g_snprintf(buff, NAME_MAX, "%s%ccontact_actions_queue",
- config_dir,
- G_DIR_SEPARATOR);
- fp = fopen(buff,"a");
- if (!fp) {
- perror(buff);
- return;
- }
-
- fprintf(fp, "%s\t%d\t%s\t%s\t%s\n",
- get_service_name(ea->service_id),
- action,
- ea->handle,
- (action!=MGMT_ADD ? ea->account_contact->group->name:"NULL"),
- (new_group!=NULL ? new_group:"NULL"));
-
- fclose(fp);
-}
-
-
-void group_mgmt_queue_add(eb_local_account *ela, char *old_group, int action,
char *new_group)
-{
- FILE *fp;
- char buff [NAME_MAX];
- g_snprintf(buff, NAME_MAX, "%s%cgroup_actions_queue",
- config_dir,
- G_DIR_SEPARATOR);
- fp = fopen(buff,"a");
- if (!fp) {
- perror(buff);
- return;
- }
-
- fprintf(fp, "%s\t%d\t%s\t%s\n",
- get_service_name(ela->service_id),
- action,
- (old_group!=NULL ? old_group:"NULL"),
- (new_group!=NULL ? new_group:"NULL"));
-
- fclose(fp);
-}
-
-int contact_mgmt_flush(eb_local_account *ela)
-{
- FILE *queue, *temp;
- char buff[NAME_MAX], queue_name[NAME_MAX], temp_name[NAME_MAX];
- char *str = NULL;
-
- /* flush groups, too */
- group_mgmt_flush(ela);
-
- g_snprintf(queue_name, NAME_MAX, "%s%ccontact_actions_queue",
- config_dir,
- G_DIR_SEPARATOR);
-
- queue = fopen(queue_name, "r");
- if (!queue)
- return 0;
- g_snprintf(temp_name, NAME_MAX, "%s%ccontact_actions_queue.new",
- config_dir,
- G_DIR_SEPARATOR);
-
- temp = fopen(temp_name, "w");
-
- if (!temp) {
- perror(buff);
- return 0;
- }
-
- while( fgets(buff, sizeof(buff), queue) != NULL )
- {
- char buff_backup[NAME_MAX];
- strcpy(buff_backup, buff);
- str = strtok( buff, "\t" );
- if(!strcmp(str,get_service_name(ela->service_id))) {
- int action = atoi(strtok(NULL,"\t"));
- char *handle = strtok(NULL,"\t");
- char *oldgroup = strtok(NULL,"\t");
- char *newgroup = strtok(NULL,"\n");
- eb_account *ea = NULL;
- int ea_recreated = TRUE;
-
- ea = find_account_by_handle(handle,
- ela->service_id);
-
- if (ea && action == MGMT_ADD &&
RUN_SERVICE(ea)->add_user) {
- RUN_SERVICE(ea)->add_user(ea);
- }
- if (ea && action == MGMT_MOV &&
RUN_SERVICE(ea)->change_group) {
- char realgrp[NAME_MAX];
- /* this is "a bit" ugly :-( */
-
strcpy(realgrp,ea->account_contact->group->name);
-
strcpy(ea->account_contact->group->name,oldgroup);
- RUN_SERVICE(ea)->change_group(ea, newgroup);
- strcpy(ea->account_contact->group->name,
realgrp);
- }
-
- if (ea && action == MGMT_REN &&
RUN_SERVICE(ea)->change_user_name) {
- RUN_SERVICE(ea)->change_user_name(ea, newgroup);
- }
-
- if (!ea) {
- ea_recreated = FALSE;
- ea = dummy_account(handle, oldgroup,
- ela->service_id);
- }
-
- if (action == MGMT_DEL && RUN_SERVICE(ea)->del_user) {
- /* some services syncing lists have
- automatically re-added our deleted
- account */
- if (ea_recreated) {
- if
(l_list_length(ea->account_contact->accounts) == 1)
-
remove_contact(ea->account_contact);
- else
- remove_account(ea);
- }
- else
- RUN_SERVICE(ea)->del_user(ea);
- }
- } else {
- /* not for me */
- fprintf(temp, "%s", buff_backup);
- }
- }
-
- fclose (temp);
- fclose (queue);
- rename (temp_name, queue_name);
- return 0;
-}
-
-int group_mgmt_check_moved(char *groupname) {
- FILE *queue, *temp;
- char buff[NAME_MAX], queue_name[NAME_MAX], temp_name[NAME_MAX];
- g_snprintf(queue_name, NAME_MAX, "%s%cgroup_actions_queue",
- config_dir,
- G_DIR_SEPARATOR);
-
- queue = fopen(queue_name, "r");
- if (!queue)
- return 0;
-
- while( fgets(buff, sizeof(buff), queue) != NULL )
- {
- char *str = strtok( buff, "\t" );
- int action = atoi(strtok(NULL,"\t"));
- char *oldgroup = strtok(NULL,"\t");
- char *newgroup = strtok(NULL,"\n");
-
- if (!strcmp(oldgroup, groupname)) {
- fclose(queue);
- return 1;
- }
- }
-
- fclose (queue);
- return 0;
-}
-
-int group_mgmt_flush(eb_local_account *ela)
-{
- FILE *queue, *temp;
- char buff[NAME_MAX], queue_name[NAME_MAX], temp_name[NAME_MAX];
- char *str = NULL;
- g_snprintf(queue_name, NAME_MAX, "%s%cgroup_actions_queue",
- config_dir,
- G_DIR_SEPARATOR);
-
- queue = fopen(queue_name, "r");
- if (!queue)
- return 0;
- g_snprintf(temp_name, NAME_MAX, "%s%cgroup_actions_queue.new",
- config_dir,
- G_DIR_SEPARATOR);
-
- temp = fopen(temp_name, "w");
-
- if (!temp) {
- perror(buff);
- return 0;
- }
-
- while( fgets(buff, sizeof(buff), queue) != NULL )
- {
- char buff_backup[NAME_MAX];
- strcpy(buff_backup, buff);
- str = strtok( buff, "\t" );
- if(!strcmp(str,get_service_name(ela->service_id))) {
- int action = atoi(strtok(NULL,"\t"));
- char *oldgroup = strtok(NULL,"\t");
- char *newgroup = strtok(NULL,"\n");
-
- if (action == MGMT_GRP_ADD &&
RUN_SERVICE(ela)->add_group) {
- RUN_SERVICE(ela)->add_group(newgroup);
- }
- if (action == MGMT_GRP_REN &&
RUN_SERVICE(ela)->rename_group) {
-
RUN_SERVICE(ela)->rename_group(oldgroup,newgroup);
- }
- if (action == MGMT_GRP_DEL &&
RUN_SERVICE(ela)->del_group) {
- RUN_SERVICE(ela)->del_group(oldgroup);
- }
- } else {
- /* not for me */
- fprintf(temp, "%s", buff_backup);
- }
- }
-
- fclose (temp);
- fclose (queue);
- rename (temp_name, queue_name);
- return 0;
-}
-
void rename_nick_log(char *oldgroup, char *oldnick, char *newgroup, char
*newnick)
{
Index: util.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/util.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- util.h 1 Feb 2003 19:25:34 -0000 1.22
+++ util.h 6 Feb 2003 08:52:42 -0000 1.23
@@ -72,17 +72,6 @@
};
-enum
-{
- MGMT_ADD,
- MGMT_DEL,
- MGMT_MOV,
- MGMT_REN,
- MGMT_GRP_ADD,
- MGMT_GRP_DEL,
- MGMT_GRP_REN
-};
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -134,11 +123,6 @@
void delete_lock_file(char* fname);
void eb_generic_menu_function(void *add_button, void * userdata);
LList * get_groups();
-void contact_mgmt_queue_add(eb_account *ea, int action, char *group);
-int contact_mgmt_flush(eb_local_account *ela);
-void group_mgmt_queue_add(eb_local_account *ela, char *old_group, int action,
char *new_group);
-int group_mgmt_flush(eb_local_account *ela);
-int group_mgmt_check_moved(char *groupname);
void rename_nick_log(char *oldgroup, char *oldnick, char *newgroup, char
*newnick);
GList * llist_to_glist(LList * l, int free_old);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ayttm-commits] CVS: ayttm/src Makefile.am,1.21,1.22 status.c,1.43,1.44 util.c,1.41,1.42 util.h,1.22,1.23,
Philip S Tellis <address@hidden> <=
- Prev by Date:
[Ayttm-commits] CVS: ayttm ChangeLog,1.276,1.277 configure.in,1.272,1.273
- Next by Date:
[Ayttm-commits] CVS: ayttm/modules/yahoo2 yahoo.c,1.39,1.40
- Previous by thread:
[Ayttm-commits] CVS: ayttm ChangeLog,1.276,1.277 configure.in,1.272,1.273
- Next by thread:
[Ayttm-commits] CVS: ayttm/modules/yahoo2 yahoo.c,1.39,1.40
- Index(es):