x-Line synchronization: Don't send negative durations
This commit is contained in:
parent
d0d4de4980
commit
0dc3c13469
|
@ -176,6 +176,7 @@ Synchronize_Lists(CLIENT * Client)
|
||||||
CHANNEL *c;
|
CHANNEL *c;
|
||||||
struct list_head *head;
|
struct list_head *head;
|
||||||
struct list_elem *elem;
|
struct list_elem *elem;
|
||||||
|
time_t t;
|
||||||
|
|
||||||
assert(Client != NULL);
|
assert(Client != NULL);
|
||||||
|
|
||||||
|
@ -183,9 +184,10 @@ Synchronize_Lists(CLIENT * Client)
|
||||||
head = Class_GetList(CLASS_GLINE);
|
head = Class_GetList(CLASS_GLINE);
|
||||||
elem = Lists_GetFirst(head);
|
elem = Lists_GetFirst(head);
|
||||||
while (elem) {
|
while (elem) {
|
||||||
|
t = Lists_GetValidity(elem) - time(NULL);
|
||||||
if (!IRC_WriteStrClient(Client, "GLINE %s %ld :%s",
|
if (!IRC_WriteStrClient(Client, "GLINE %s %ld :%s",
|
||||||
Lists_GetMask(elem),
|
Lists_GetMask(elem),
|
||||||
(long)(Lists_GetValidity(elem) - time(NULL)),
|
t > 0 ? (long)t : 0,
|
||||||
Lists_GetReason(elem)))
|
Lists_GetReason(elem)))
|
||||||
return DISCONNECTED;
|
return DISCONNECTED;
|
||||||
elem = Lists_GetNext(elem);
|
elem = Lists_GetNext(elem);
|
||||||
|
|
Loading…
Reference in New Issue