aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/subscriptions.c7
-rw-r--r--common/subscriptions.h5
2 files changed, 7 insertions, 5 deletions
diff --git a/common/subscriptions.c b/common/subscriptions.c
index 529c339..60ce002 100644
--- a/common/subscriptions.c
+++ b/common/subscriptions.c
@@ -1,12 +1,12 @@
#include "subscriptions.h"
-void common_subscription_add(struct subscription** subscriptions, const char* rid, const char* name, enum subscription_type type, size_t unread)
+void common_subscription_add(struct subscription** subscriptions, const char* rid, const char* name, enum subscription_type type, size_t unread, char alert)
{
- struct subscription * subscription = common_subscription_new(rid, name, type, unread);
+ struct subscription * subscription = common_subscription_new(rid, name, type, unread, alert);
HASH_ADD_KEYPTR(hh, *subscriptions, subscription->rid, strlen(rid), subscription);
}
-struct subscription* common_subscription_new(const char* rid, const char* name, enum subscription_type type, size_t unread)
+struct subscription* common_subscription_new(const char* rid, const char* name, enum subscription_type type, size_t unread, char alert)
{
struct subscription* subscription = malloc(sizeof(struct subscription));
subscription->rid = malloc(strlen(rid) + 1);
@@ -15,6 +15,7 @@ struct subscription* common_subscription_new(const char* rid, const char* name,
strcpy(subscription->name, name);
subscription->type = type;
subscription->unread = unread;
+ subscription->alert = alert;
return subscription;
}
diff --git a/common/subscriptions.h b/common/subscriptions.h
index e6f4771..1c42ad0 100644
--- a/common/subscriptions.h
+++ b/common/subscriptions.h
@@ -14,11 +14,12 @@ struct subscription {
char* name;
enum subscription_type type;
size_t unread;
+ char alert;
UT_hash_handle hh;
};
-void common_subscription_add(struct subscription** subscriptions, const char* id, const char* name, enum subscription_type type, size_t unread);
-struct subscription* common_subscription_new(const char* rid, const char* name, enum subscription_type type, size_t unread);
+void common_subscription_add(struct subscription** subscriptions, const char* id, const char* name, enum subscription_type type, size_t unread, char alert);
+struct subscription* common_subscription_new(const char* rid, const char* name, enum subscription_type type, size_t unread, char alert);
void common_subscriptions_free(struct subscription* subscriptions);
void common_subscriptions_const_walk(const struct subscription* subscriptions, void (*func)(const struct subscription*));
size_t common_subscriptions_count(const struct subscription* subscriptions);