ayttm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ayttm-commits] CVS: ayttm/src service.c,1.15,1.15.2.1


From: Andy Maloney <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/src service.c,1.15,1.15.2.1
Date: Mon, 24 Mar 2003 03:59:57 -0500

Update of /cvsroot/ayttm/ayttm/src
In directory subversions:/tmp/cvs-serv9242

Modified Files:
      Tag: new_prefs
        service.c 
Log Message:
Move reload_service_accounts() to service.c from prefs.[ch]


Index: service.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/service.c,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -u -r1.15 -r1.15.2.1
--- service.c   29 Jan 2003 19:19:23 -0000      1.15
+++ service.c   24 Mar 2003 08:59:54 -0000      1.15.2.1
@@ -22,9 +22,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include "intl.h"
 
 #include <gtk/gtk.h>
 #include <gdk/gdkprivate.h>
@@ -101,6 +99,45 @@
        eb_debug(DBG_CORE, "<Leaving\n");
        return;
 }
+
+static void reload_service_accounts(int service_id)
+{
+       LList                           *node = accounts;
+       LList                           *account_pairs = NULL;
+       eb_local_account        *oela = NULL;
+       eb_local_account        *nela = NULL;
+       const int                       buffer_size = 256;
+       char                            buff[buffer_size];
+       char                            buff2[buffer_size];
+
+       while(node)
+       {
+               oela=node->data;
+               if(oela->service_id != service_id || oela->connected) {
+                       node = node->next;
+                       continue;
+               }
+               eb_debug(DBG_CORE, "Account: handle:%s service: %s\n", 
oela->handle, get_service_name(oela->service_id));
+               snprintf(buff, buffer_size, "%s:%s", 
get_service_name(oela->service_id), oela->handle);
+               account_pairs = GetPref(buff);
+               nela = 
eb_services[oela->service_id].sc->read_local_account_config(account_pairs);
+               if(!nela) {
+                       snprintf(buff2, buffer_size, _("Unable to create 
account for %s.\nCheck your config file."), buff);
+                       do_error_dialog(buff2, _("Invalid account"));
+                       oela->service_id=get_service_id("NO SERVICE");
+               }
+               else {
+                       nela->service_id = oela->service_id;
+                       node->data=nela;
+                       //FIXME: This should probably be left to the service to 
clean up, though at this point, it may not exist
+                       free(oela->handle);
+                       free(oela->protocol_local_account_data);
+                       free(oela);
+               }
+               node = node->next;
+       }
+}
+
 
 /* Add a new service, or replace an existing one */
 int add_service(struct service *Service_Info)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]